You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For a description of each of these endpoints, see the Project Architecture
Follow proper API conventions and return status codes along with your response. Namely 200, 404, 500, etc.
Put your endpoints into /server/routes/[FILENAME].js
Replace FILENAME with the name of the DB table that the endpoint is for. Don't Forget: use the keysToCamel function, as seen in the sample users.ts file, to make the SQL keys into camel case
Some sample files have been provided.
Steps
Create file for each endpoint (events)
Create a router for this file (see examples)
Import and place this router into /server/src/App.ts (see line 40)
Create the functions for get/post/put (delete if specified)
Example
GET /users/:id
Place this into /server/routes/users.js
See users.ts for the best examples.
Notes
To test your implementation, you can use Postman like we have in the bootcamps.
If you put your endpoints in sample.js (for example only), then you will need to send requests to:
127.0.0.1:3001/sample/<your_endpoint> OR localhost:3001/sample/<your_endpoint>
Quote
Description
Instructions
Setup
Before you can work on the repo, you need to add the secrets.
For the Frontend .env, put it in
/client
.For the Backend .env, put it in
/server
.You also need to add this file in
/server/config
Task
Create the following API endpoints:
For a description of each of these endpoints, see the Project Architecture
Follow proper API conventions and return status codes along with your response. Namely 200, 404, 500, etc.
Put your endpoints into
/server/routes/[FILENAME].js
Replace FILENAME with the name of the DB table that the endpoint is for.
Don't Forget: use the keysToCamel function, as seen in the sample
users.ts
file, to make the SQL keys into camel caseSome sample files have been provided.
Steps
/server/src/App.ts
(see line 40)Example
GET /users/:id
Place this into /server/routes/users.js
See users.ts for the best examples.
Notes
To test your implementation, you can use Postman like we have in the bootcamps.
If you put your endpoints in sample.js (for example only), then you will need to send requests to:
127.0.0.1:3001/sample/<your_endpoint> OR localhost:3001/sample/<your_endpoint>
Resources
The text was updated successfully, but these errors were encountered: