Skip to content

This is just a demo project for a node.js REST Api

Notifications You must be signed in to change notification settings

KaiWelu/node-rest-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About

This is a Node.js REST API demo project to explore concepts like authentication, salting, controllers, schemas, session tokens, routing, middleware and restful APIs. Features include creating, updating, deleting and authenticating users.

Tech used

How to run

Setup an .env file like this:

SECRET = [YOUR_SECRET]
MONGO_URL = [YOUR_MONGODB_URL]

You can run the api locally with:

npm run start

Routes

POST /auth/register

{
    "email": "second@second1.com",
    "password": "1234",
    "username": "Caesar"
}

POST /auth/login

{
    "email": "second@second1.com",
    "password": "1234",
    "username": "Caesar"
}

GET /users (gets all users but you have to be logged in)

DEL /users/:id (deletes your user but you have to be logged in)

PATCH /users/:id

{
    "username": "Quintus"
}

About

This is just a demo project for a node.js REST Api

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published