Node JS, Express, JWT to work with my react calendar app
For locally setup please create a .env
file and configure the next variables:
- PORT
- DB_CNN = MongoAtlas DB
- SECRET_JWT_SEED
The application is built under a small NodeJS backend, and uses the following endpoints:
METHOD | ENDPOINT | DESCRIPTION |
---|---|---|
POST | localhost + /api/auth/new | Create an user |
POST | localhost + /api/auth/ | Log in |
GET | localhost + /api/events/ | Gets all event, Remember to add the JWT token `x-token` in the header. |
POST | localhost + /api/events/ | Create an event, Remember to add the JWT token `x-token` in the header. |
PUT | localhost + /api/events/:id | Remember to add the JWT token `x-token` in the header. and also keep in mind just the event creator can update the event. |
DELETE | localhost + /api/events/:id | Remember to add the JWT token `x-token` in the header. and also keep in mind just the event creator can delete the event. |