This application is the backend of a project built in React. You can see the source code of the frontend application here
Change the name of file .example.env
to .env
and assign values to the variables
PORT
: server portDB_CNN
: mongodb string connectionSECRET_JWT_SEED
: Phrase that is the JWT secret key
To can see the visual part, follow the instructions here
To run the backend:
npm install # install dependencies
npm start # production
npm run dev # development
LOGIN:
- Create a new user
POST /api/auth/new
Body:
{
"name": "nombre",
"password": "password",
"email": "[email protected]"
}
- Login an user
POST /api/auth
Body:
{
"password": "123456789",
"email": "[email protected]"
}
- Revalid token
POST /api/auth/renew
Request Headers:
x-token: token
EVENTS:
- Get Events
GET /api/events
Request Headers:
x-token: token
- Create an event
POST /api/events
Request Headers:
x-token: token
Body:
{
"title": "This is an entry",
"start": 10000,
"end": 200000,
"notes": "This is a note",
}
- Update Event
PUT /api/events/<ID-EVENT>
x-token: token
Body:
{
"title": "This is an entry",
"start": 10000,
"end": 200000,
"notes": "This is a note",
}
- Delete Event
DEL /api/events/<ID-EVENT>
x-token: token