Skip to content

purewebstar/demo-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

demo for user account with creative-tim frontend (reactjs)

Technologies used:

1. Backend

  • Nodejs
  • ExpressJs
  • MongoDb

Dependency install

npm install --save

Dependencies are:

express, bcryptjs, helmet, cors, jsonwebtoken, mongoose, dotenv, cookie-parser, passport, passport-jwt, nodemailer

Dev Dependency install

npm install --save-dev

Dev Dependency is:

nodemon

Run Project

npm run devStart

Or

nodemon server.js

Environment Variables

PORT=?
DATABASE_URI=?
SECRET_KEY=?
SITE_HOST=?

API Endpoints

Register
POST http://localhost:4000/api/signup
Content-Type: application/json

{
    "name": "your name",
    "email": "your email",
    "password": "your password"
}
Login
POST http://localhost:4000/api/login
Content-Type: application/json

{
    "email": "your email",
    "password": "your password"
}
Read Profile
GET http://localhost:4000/api/read-profile
Content-Type: application/json
Authorization: Bearer <access-token>
Update Profile
POST http://localhost:4000/api/update-profile
Content-Type: application/json
Authorization: Bearer <access-token>

{
    "name": "your name"
    "email": "your email"
}
Verify Email
POST http://localhost:4000/api/users/confirm/:id
Content-Type: application/json
Refresh Token
POST http://localhost:4000/api/auth/refresh-token/:token
Content-Type: application/json
{
    "token": "your refresh-token"
}
Renew Access Token
PUT http://localhost:4000/api/auth/renew-access-token/:token
Content-Type: application/json
{
    "refreshToken": "your refresh-token"
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published