Delpoyed URL: https://build-restaurant-passport.herokuapp.com
{
id: integer, do not send this is automatically generated
username: string, required
password: string, required
email: string, required
}
{
id: integer, do not send this is automatically generated
name: string
}
{
name: string, required
city: string, required
address: string, required
description: string, required
city_id integer, required, references id of city
}
Method | Endpoint | Token Required | Description |
---|---|---|---|
POST | /users/register |
no | Registers a new user Required: username, password, and department. Returns id, username, and email. |
POST | /users/login |
no | Required: username and password Signs in user and returns a token and userId |
Method | Endpoint | Token Required | Description |
---|---|---|---|
GET | /cities |
yes | Returns all cities |
POST | /cities/ |
yes | Reqired: name Adds a city to the database |
POST | /cities/restaurants |
yes | Required: name. city, address, description, city_id Adds a restaurant to the database |
GET | /cities/:id/restaurants |
yes | Returns name and id of restaurants in a city by city id |
GET | /cities/restaurants/:id |
yes | Returns a restaurant by id |