Created by Harvey Lucas
> npm init -y
> npm install dotenv express jest supertest pg sequelize sequelize-cli sqlite3
Build a REST API using Express, by creating a proper series of endpoints that perform CRUD operations on a database, using the REST standard
Heroku main branch deploy: https://tripppdx-basic-api-server.herokuapp.com/
-
HTTP GET
- Path: /person
- responds with the string used in request query
?name=string
.
- responds with the string used in request query
- Path: /person
-
HTTP GET
- Path: /food ; /clothes
- Returns: An array of objects, each object being one entry from the database.
- Path: /food ; /clothes
-
HTTP GET
- Path: /food/1 ; /clothes/1
- Returns: The object from the database, which has the id matching that which is in the path.
- Path: /food/1 ; /clothes/1
-
HTTP POST
- Path: /food ; /clothes
- Returns: The record that was added to the database.
- Path: /food ; /clothes
-
HTTP PUT
- Path: /food ; /clothes
- Returns: The object from the database, which has the id matching that which is in the path, with the updated/changed data.
- Path: /food ; /clothes
-
HTTP DELETE
- Path: /food/1 ; /clothes/1
- Returns: The record from the database as it exists after you delete it (i.e. null)
- Path: /food/1 ; /clothes/1