Giter Site home page Giter Site logo

oauthapi's Introduction

Project Description

The API is basically developed using NodeJS, MongoDB and Docker.

dockerfile

This file has two sections for multi-stage which include production and development. Production is derived from node-alpine image which install package targeted for production only. Development is derived from production and install all package.json.

USE POSTMAN Application to call below API methods

login with the link below and credentials

This is the first step of generating a token key. Client app should pass valid username and password. POST Method http://HOST_NAME:PORT_NUMBER/login

{ "username":"USER_NAME.", "password":"PASSWORD" }

Add new users - ADMIN Role ONLY

POST Method http://HOST_NAME:PORT_NUMBER/addnewusers

{"username":string,"password":string,"name":string,"lastname":string,"age":number,"role":string admin|client}

HEADERS KEY: Authorization VALUE: "TOKEN KEY PROVIDED DURING LOGIN

Get list of users - ADMIN Role ONLY

GET Method http://HOST_NAME:PORT_NUMBER/userslist/

HEADERS KEY: Authorization VALUE: "TOKEN KEY PROVIDED DURING LOGIN

Get users details - ADMIN Role ONLY

Get Method http://localhost:3000/userdetails/?username=USER_NAME--> query prametrer

HEADERS KEY: Authorization VALUE: "TOKEN KEY PROVIDED DURING LOGIN

Add new users - ADMIN Role ONLY

POST Method http://HOST_NAME:PORT_NUMBER/addnewproducts/

{"name":string,"price":Number,"description":String,"created_by":string}

HEADERS KEY: Authorization VALUE: "TOKEN KEY PROVIDED DURING LOGIN

Get list of products - EVERYONE

Get Method http://HOST_NAME:PORT_NUMBER/getproductlist/

HEADERS KEY: Authorization VALUE: "TOKEN KEY PROVIDED DURING LOGIN

Get product details - EVERYONE

Get Method http://HOST_NAME:PORT_NUMBER/getproductdetails/?name=PARAM --- get query param

HEADERS KEY: Authorization VALUE: "TOKEN KEY PROVIDED DURING LOGIN

Update product details - ADMIN Role ONLY

POST Method http://HOST_NAME:PORT_NUMBER/updateproducts/

{"name":string,"price":Number,"description":String}

HEADERS KEY: Authorization VALUE: "TOKEN KEY PROVIDED DURING LOGIN#

Delete product details - ADMIN ONLY

Get Method http://HOST_NAME:PORT_NUMBER/deleteproducts/?name=PARAM --- get query param

HEADERS KEY: Authorization VALUE: "TOKEN KEY PROVIDED DURING LOGIN

oauthapi's People

Contributors

izzumani avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.