For endpoints testing use => Deployed API: https://nea-server.herokuapp.com/
npm i
to install node modules.
npm run seed
to seed database with CSV file.
npm run dev
to run in development.
findAll and addList are unprotected for both models(nea and user) thus you can check it without auth.
If you want to test the rest of endpoints use:
username: carlos - password: 1234
for login. This will return a token.
Or you can signup using the POST endpoint /api/auth this will return a token valid for 1 hour.
Use the token in your headers as x-auth-token and use Content-Type: application/json to access all the endpoints.
Endpoints>>>
Auth
POST: /api/auth to sign up
POST: /api/auth/login to log in
GET: /api/auth/loggedUser to check current logged user
NEAs
POST: /api/nea to add a list of neas (unprotected)
GET: /api/nea to get all neas (unprotected)
GET: /api/nea/:id to get specific nea
PUT: /api/nea/:id to update one nea
DELETE: /api/nea/:id to remove one nea
Users
POST: /api/user to add a list of users (unprotected)
GET: /api/user to get all users (unprotected)
GET: /api/user/:id to get one user
PUT: /api/user/:id to update a user (must be the one that is logged in)
DELETE: /api/user/:id to remove a user (must be the one that is logged in)