Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/toymachiner62/rest-excercise
Coding excercise
https://github.com/toymachiner62/rest-excercise
Last synced: 30 days ago
JSON representation
Coding excercise
- Host: GitHub
- URL: https://github.com/toymachiner62/rest-excercise
- Owner: toymachiner62
- Created: 2020-04-30T15:27:01.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-01-24T02:21:38.000Z (almost 2 years ago)
- Last Synced: 2024-04-17T06:40:52.609Z (7 months ago)
- Language: JavaScript
- Size: 179 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# rest-excercise
> [Tom Caflisch](http://linkedin.com/in/tomcaflisch) coding excerciseA simple REST example project with some basic CRUD operations for contacts.
The code has unit tests which mock the actual db so they are true unit tests instead of being functional tests. I could have easily used the in memory db for unit tests as well, but I chose to demonstrate my ability to use dependency injection instead.
## Usage
Install dependencies
```sh
$ npm install
```Start server
```sh
$ npm start
```Endpoints that exist:
```
POST http://localhost:3000/contacts
GET http://localhost:3000/contacts
GET http://localhost:3000/contacts/:id
PUT http://localhost:3000/contacts/:id
DELETE http://localhost:3000/contacts/:id
```## Testing
```sh
$ npm test
```