Skip to content

Back-End part for Counter Strike Global Offensive item database.

Notifications You must be signed in to change notification settings

boranfurkan/CSGO-ITEM-DATABASE-BACK-END

Repository files navigation

Setup

npm install && npm start

Database Connection

  1. Import connect.js
  2. Invoke in start()
  3. Setup .env in the root
  4. Add MONGO_URI with correct value

Routers

  • auth.js
  • items.js

Register User

  • Validate - username, password - with Mongoose
  • Hash Password (with bcryptjs)
  • Save User
  • Generate Token
  • Send Response with Token

Login User

  • Validate - username, password - in controller
  • If username or password is missing, throw BadRequestError
  • Find User
  • Compare Passwords
  • If no user or password does not match, throw UnauthenticatedError
  • If correct, generate Token
  • Send Response with Token

Mongoose Errors

  • Validation Errors
  • Duplicate (username)
  • Cast Error

Security

  • helmet
  • cors
  • xss-clean
  • express-rate-limit

Swagger UI

About

Back-End part for Counter Strike Global Offensive item database.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published