Skip to content

cmglezpdev/Calendar-App-Backend

Repository files navigation

Calendar App

This application is the backend of a project built in React. You can see the source code of the frontend application here

Environment Variables

Change the name of file .example.env to .env and assign values to the variables

  • PORT: server port
  • DB_CNN: mongodb string connection
  • SECRET_JWT_SEED: Phrase that is the JWT secret key

Run App

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

Endpoints

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

About

Backend con express de la aplicacion de Calendario

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published