Skip to content

RESTful API using express js (Auth) + mongoDB build simple project

Notifications You must be signed in to change notification settings

yokihg/express-api

Repository files navigation

Express RESTful API (Auth)

RESTful API using express js (Auth) + mongoDB build simple project

Installation

    1. npm i -g nodemon #If not installed
    2. npm install

Start server

    1. npm start #command in package.json

Open Api

    1. Register Api POST : http://127.0.0.1:3000/api/users
    2. Auth Api POST : http://127.0.0.1:3000/api/auth #return token
    3. Other api : /genres, /customers, /rentals, /movies etc. #before add header token key=x-auth-token
    Example.
        - http://127.0.0.1:3000/api/genres   
        - http://127.0.0.1:3000/api/customers
        - http://127.0.0.1:3000/api/rentals
        - http://127.0.0.1:3000/api/movies

Script data test

    Can import collection data to mongoDB => resources/data/*.json

RESTful API Designing guidelines 

GET /api/genres

POST /api/genres

PUT /api/genres/:id

DELETE /api/genres/:id

Recommend tools

    Call api Postman

About

RESTful API using express js (Auth) + mongoDB build simple project

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published