- git clone https://github.com/tapatio/note-service.git
- npm update
- npm install
- npm run start
- open your browser and navigate to http://localhost:8081/api-docs
- npm run test
The service provides the following features:
- Route to verify service is up.
- Route that returns all notes.
- Route that returns a note given it's id.
- Route to add one or more notes.
- Route to edit a note.
- Route to delete one or more notes.
- Route to search for notes given keywords.
- Note storage using lowdb.
- Route validation.
- Unit tests.
- Postman Collection.
- Swagger UI.
| HTTP | Route | Query Parameters | Path Parameters | Body Payload | Return Values |
|---|---|---|---|---|---|
| GET | /ping | None | None | None | Returns 200 with text "Success". Quick check to see if service is running. |
| GET | /note/all | None | None | None | Returns 200 with JSON array of all notes currently stored. |
| GET | /note | id=NoteId | None | None | Returns 200 with JSON note, 404 if not found. |
| POST | /note | None | None | JSON array of notes | Returns 200 with JSON array of notes corresponding to notes stored. |
| PUT | /note | None | None | JSON note with noteId | Returns 200 with JSON noteId, 404 if note UUID not found. |
| delete | /note | None | None | JSON array of noteIds | Returns 200. |
| GET | /note/search | keywords="words to search" | None | None | Returns 200 with JSON array of notes that contain all of keywords. |
- Node v10.15.0
- NPM v6.4.1