Skip to content

An example of a microservice for an object called User

Notifications You must be signed in to change notification settings

meesont/ExampleService

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ExampleService

An example of a microservice for an object called User

Uses MongoDB/Morphia as an example of data persistence within the microservice.

Endpoints

/users [GET]

Returns all users

Response:

{
  "status": "SUCCESS",
  "data": [
    {
      "id": "1",
      "forename": "Tom",
      "surname": "Meeson",
      "email": "[email protected]"
    },
    {
      "id": "2",
      "forename": "John",
      "surname": "Smith",
      "email": "[email protected]"
    }
  ]
} 

/users [POST]

Adds a new user to the system

Response:

{
  "status": "SUCCESS"
}

/users/:id [GET]

Get a specific user by their ID

Response:

{
  "status": "SUCCESS",
  "data":{
    "id": "3",
    "forename": "Bob",
    "surname": "Bobby",
    "email": "[email protected]"
  }
}

/users/:id [PUT]

Edit a specific user's properties

Response:

{
  "status": "SUCCESS",
  "data":{
    "id": "3",
    "forename": "Bob",
    "surname": "Bobby",
    "email": "[email protected]"
  }
}

/users/:id [DELETE]

Deletes a specific user's data

Response:

{
  "status": "SUCCESS",
  "message": "user deleted"
}

/users/:id [OPTIONS]

Checks if a user with given ID exists

Response:

{
  "status": "SUCCESS",
  "message": "user exists"
}

About

An example of a microservice for an object called User

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages