Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/toymachiner62/rest-excercise

Coding excercise
https://github.com/toymachiner62/rest-excercise

Last synced: 30 days ago
JSON representation

Coding excercise

Awesome Lists containing this project

README

        

# rest-excercise
> [Tom Caflisch](http://linkedin.com/in/tomcaflisch) coding excercise

A 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
```