Skip to content

pascholynx/blog_api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

blog_api

Altschool Second Semester Exam Project


Requirements

  1. User should be able to register
  2. User should be able to login with Passport using JWT
  3. Implement basic auth
  4. User should be able to get orders
  5. Users should be able to create orders
  6. Users should be able to update and delete orders
  7. Test application

Setup

  • Install NodeJS, mongodb
  • pull this repo
  • update env with example.env
  • run npm run start:dev

Base URL

  • somehostsite.com

Models


User

field data_type constraints
id string required
username string required
firstname string optional
lastname string optional
email string optional
password string required

Blogs

field data_type constraints
id string required
timestamp date required
state String required,default:draft
description String required
author String required
content string required
readCount number required
readingTime string required

APIs


Signup User

  • Route: /signup
  • Method: POST
  • Body:
{
  "email": "doe@example.com",
  "password": "Password1",
  "firstname": "jon",
  "lastname": "doe",
  "username": 'jon_doe",
}
  • Responses

Success

{
    message: 'Signup successful',
    user: {
        "email": "doe@example.com",
        "password": "Password1",
        "firstname": "jon",
        "lastname": "doe",
        "username": 'jon_doe",
    }
}

Login User

  • Route: /login
  • Method: POST
  • Body:
{
  "password": "Password1",
  "username": 'jon_doe",
}
  • Responses

Success

{
    message: 'Login successful',
    token: 'sjlkafjkldsfjsd'
}

...

Contributor

  • Chidozie Inya

About

Altschool Second Semester Exam Project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors