Skip to content

User Service

Hrishikesh Paul edited this page Feb 21, 2021 · 10 revisions

User Service

This service handles all data that concerns the user. Stores the user's email id, name and photo url. This service is actively involved in logging the user in.

  • Framework: NodeJS (with ExpressJS)
  • Language: JavaScript
  • Database: MongoDB (with Mongoose)
  • Dev server: http://localhost:3000

How To Run

$ cd scrapbook-user-service
$ npm install
$ npm run dev

APIs

Method Route Description Response Status Request Obj Response Obj
POST /users/login Find or adds the database, and returns the user that is used to login. 200 (if user exists), 201 (if new user has been added), 400 (bad request) {email: string, name: string, photo: string} User Object, Error Object
GET /users/:id Get an user by ID. 200 (if user exists),400 (bad request) id User Object, Error Object
GET /users/search/:sub Search user by substring (on name). 200 (if user exists),400 (bad request) substring Users Object, Error Object
Clone this wiki locally