Simple CRUD API using in-memory database.
- Download & Install Git
- Download & Install Node.js and the npm package manager
- Install dependencies
npm install
Launch an app in development mode
npm run start:dev
Launch an app in production mode
npm run start:prod
- GET
api/users
is used to get all persons- Server should answer with
status code
200 and all users records
- Server should answer with
- GET
api/users/${userId}
- Server should answer with
status code
200 and and record withid === userId
if it exists - Server should answer with
status code
400 and corresponding message ifuserId
is invalid (notuuid
) - Server should answer with
status code
404 and corresponding message if record withid === userId
doesn't exist
- Server should answer with
- POST
api/users
is used to create record about new user and store it in database- Server should answer with
status code
201 and newly created record - Server should answer with
status code
400 and corresponding message if requestbody
does not contain required fields
- Server should answer with
- PUT
api/users/${userId}
is used to update existing user- Server should answer with
status code
200 and updated record - Server should answer with
status code
400 and corresponding message ifuserId
is invalid (notuuid
) - Server should answer with
status code
404 and corresponding message if record withid === userId
doesn't exist
- Server should answer with
- DELETE
api/users/${userId}
is used to delete existing user from database- Server should answer with
status code
204 if the record is found and deleted - Server should answer with
status code
400 and corresponding message ifuserId
is invalid (notuuid
) - Server should answer with
status code
404 and corresponding message if record withid === userId
doesn't exist
- Server should answer with
Start tests
npm run test