Giter Site home page Giter Site logo

auth-service's Introduction

auth-service

This project acts as authorisation service where a user can register and login with a unique key generatd to them Built with NodeJs, ExpressJS & MongoDB.

Setup

  1. Clone the Repo:
git clone https://github.com/RupakQuestDot/auth-service.git
  1. Navigate to root directory
cd backend-service
  1. Install node dependencies
npm install (or) yarn install
  1. Start development server
npm run dev (or) yarn run dev

Production

  1. Live server
npm start (or) yarn start

Configuration

Go .env file in the root directory and do required changes

DB_URL = "ADD YOUR OWN DB URL"

Middlewares Used

  1. body-parser - The body parser middleware is especially used to extract the body from the incoming requests. In short, it extracts the data out of the request headers like the form data, etc,. It provides four modules to parse different types of data including, JSON body parser.
  2. multer - Multer is a node. js middleware for handling multipart/form-data , which is primarily used for uploading files.
  3. morgan- Morgan is a HTTP request logger middleware for Node. js. It simplifies the process of logging requests to your application. You might think of Morgan as a helper that generates request logs.

Testing

Use Postman as GUI tool to test the api end points.

API END POINTS

Once run the application. Then navigate to url localhost:8082/api/ method GET you will get the response as 'Welcome to CRUD USER AUTH API @8082..!'.

  1. Regitsering a user HTTP METHOD ==> POST , URL : localhost:8082/api/users/register. Register user with name, password, role. All fields are manditory.

  2. Sign In a user HTTP METHOD ==> POST, URL: localhost:8082/api/auth/login. Login with entries name, password. On sucessful login you will get a token which is a autherisation token. This token can be used for further operations.

  3. List ALL Users HTTP METHOD ==> GET, URL: localhost:8082/api/users. You will be able to fetch all the users from the Database.

auth-service's People

Contributors

rupakquestdot avatar

Watchers

 avatar  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.