Skip to content

Latest commit

 

History

History
44 lines (32 loc) · 1.31 KB

README.md

File metadata and controls

44 lines (32 loc) · 1.31 KB

Users Articles

A side project to test out clean code, express, building my own mock db

Features

  1. User registration/login system with Passport using Local Strategy with JWT token implementaion.
  2. Protected routes with authmiddleware that checks for JWT validation using expressJWT
  3. Mocked database, so no database is required.
  4. Auto generated fake data for users and users posts.
  5. Cron job that runs every minute (can be modified) to drop database and seed new data every 1 hour.

Routes

Auth

  1. POST /api/auth/register
  2. POST /api/auth/login
  3. GET (JWT Protected) /api/auth/me

Posts

  1. GET /api/posts
  2. GET /api/posts/1
  3. GET /api/posts/:authorId
  4. POST (JWT Protected) /api/posts/add
  5. PUT (JWT Protected) /api/posts/1
  6. DELETE (JWT Protected) /api/posts/1

To run in development mode

npm start

To build

npm run build