Skip to content

Karthik-Sunil-K/Blog-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Getting started

Clone repository

git clone https://github.com/Karthik-Sunil-K/Blog-API.git
cd Blog-API/

Initiate npm

npm init

Install npm packages

npm i express nodemon bcrypt mongoose dotenv

Now create .env file Add the mongodb url in .env file

MONGO_URL=mongodb+srv://karthik:karthik01@node-rest-shop.a4rqb.mongodb.net/?retryWrites=true&w=majority

Add this script in package.json

"scripts": {
    "start": "nodemon app.js"
  },

Start server

nodemon start

Route url:

-http://localhost:3000

End points

Authentication

Register User:

POST  /api/v1/auth/register/

Example Input:

    {
    "username": "nodemon app.js",
    "email":"karthik@gmail.com",
    "password":"1234"
    },

Output:

    {
      message:"user created succesfully"
    }

Login user

POST /api/v1/auth/login/

Example Input:

    {
    "username": "nodemon app.js",
    "password":"1234"
    },

Output:

    {
       message: "logined successfully",
    }

user routes:

PUT   /api/v1/user/update/:id
DELET   /api/v1/user/update/:id
GET    /api/v1/user/update/:id
PATCH  /api/v1/user/update/:id

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published