Skip to content

vitaly-sazonov/simple-crud-api

Repository files navigation

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published