Skip to content

Latest commit

 

History

History
39 lines (29 loc) · 1.06 KB

README.md

File metadata and controls

39 lines (29 loc) · 1.06 KB

Simple CRUD API

Http server which provides the ability to Create, Update, Read and Delete data in an in-memory database.

Command syntax

$ npm i
# installing dependencies

$ npm run start:dev
# starting the server in development mode

$ npm run start:prod
# starting the server in prodaction mode

Now you can send requests to the server:

  • GET /person or /person/{personId}
    • 'personId' is of type uuid
  • POST /person {name, age, hobbies}
    • body properties 'name', 'age', 'hobbies' required
    • example -> { name: 'Vasya', age: '20', hobbies: "['walk','fight','drink']" }
  • PUT /person/{personId} {name, age, hobbies}
    • updating data in the database according to the data from the request body
    • example -> { name: 'Vasya', age: '20', hobbies: "['only drink']" }
  • DELETE/person/{personId}
    • delete record from the database with {personId}

Command testing

# testing with detailed description
$ npm run test

# testing in development mode and watch for updates of test files
$ npm run test:dev