Giter VIP home page Giter VIP logo

back-end's Introduction

1.npm install

install all pacakges for the app

2. add .env file to the root directory

check the .env.example file on the root directory and copy the enironment variables to the created .env file, then add the PORT you wanted or leave it and the app will switch to PORT 4001

The MONGO_ATLAS_PSWD variable is optional unless you don't have a locally installed MONGODB The JWT_SECRET variable can be set to fleskai

3. run the app with node index or if you preffer nodemon index

4. test the api with what you want, either postman or any client that can perform http operations

http://localhost:4001/auth/signup Change the host, and port if it's different in your devices and that will reruire the POST body of JSON object of {firsname,lastname,username,email,age,password} error will return if anything is wrong from the sent request payload, else a success message will return when saved to the database...and don't forget the database is running first if it's storing locally

http://localhost:4001/auth/login Will require email and password used to register else it won't authenticate and after its correct, a token will be sent back and that'll be used to access PROTECTED routes sent along ewith the authorization value in the request headers

http://localhost:4001/superadmin/allusers Get all user but won't return anything unless the token is send together with the request headers (roles that suppose to access it isnt imolemented yet)

http://localhost:4001/auth/me/userId User id will be return with message when registerd, o that will be bind with this GET request to get the details of one specific user, also token must be parse with headers (Access control isnt implemented to here)

http://localhost:4000/superAdmin/deleteuser/userId Delete one specific user base on id also protected eoth token (Acess control of who should perform operation isnt implemented to)

DATA SENT MUST BE IN FORM OF JSON DATATYPE!

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.