Skip to content

almamarie/my-unsplash-backend

Repository files navigation

{My Unsplash}

Solution for a challenge from Devchallenges.io.

TODO: Complete the portion below

Table of Contents

Overview

screenshot

Introduce your projects by taking a screenshot or a gif. Try to tell visitors a story about your project by answering:

  • Where can I see your demo?
  • What was your experience?
  • What have you learned/improved?
  • Your wisdom? :)

Built With

Features

This application/site was created as a submission to a DevChallenges challenge. The challenge was to build an application to complete the given user stories.

How To Use

To clone and run this application, you'll need Git and Node.js (which comes with npm) installed on your computer. From your command line:

# Clone this repository
$ git clone https://github.com/your-user-name/your-project-name

# Install dependencies
$ npm install

# Run the app
$ npm start

Acknowledgements

Contact


Getting Started

Base URL: At present this app can only be run locally and is not hosted as a base URL. The backend app is hosted at the default, http://127.0.0.1:5000/, which is set as a proxy in the frontend configuration.

Authentication: This version of the application does not require authentication or API keys. Error Handling Errors are returned as JSON objects in the following format:

{
"success": False,
"error": 400,
"message": "bad request"
}

There are 2 ways errors will be sent to the client:

  1. These are the http error codes. The API will return three error types when requests fail in the format presented above:

400: Bad Request 404: Resource Not Found 422: Not Processable 405: Method Not Allowed

  1. The status_code is 200 but the error is stated in the body of the response. The format is as stated below:
{
"success": False,
"message": "item exists in database. no duplicate items allowed"
}

Endpoints

GET '/categories'

Fetches a dictionary of categories in which the keys are the ids and the value is the corresponding string of the category

Request Arguments: None

Returns: An object with a single key, categories, that contains an object of id: category_string key:value pairs.

{
  "categories": {
    "1": "Science",
    "2": "Art",
    "3": "Geography",
    "4": "History",
    "5": "Entertainment",
    "6": "Sports"
  }
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published