Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tsamaya/todo-restify-api-docker
a To-Do API With Node and Restify
https://github.com/tsamaya/todo-restify-api-docker
Last synced: 4 days ago
JSON representation
a To-Do API With Node and Restify
- Host: GitHub
- URL: https://github.com/tsamaya/todo-restify-api-docker
- Owner: tsamaya
- License: mit
- Created: 2017-09-22T06:54:42.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-03-03T10:57:13.000Z (over 1 year ago)
- Last Synced: 2024-05-02T04:34:37.169Z (7 months ago)
- Language: JavaScript
- Size: 208 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Build a To-Do API With Node and Restify
This is a simple todo API based on restify.
This todo app is ased on Chinedu Izuchukwu's post at https://code.tutsplus.com/tutorials/build-todo-api-with-node-and-restify--cms-29402
What did I add ?
- a docker-compose file so the API is containerized and will not impact your host,
- eslint with airbnb base rules, where I only remove the traling comma, because this is the only thing wrong on their config, IMHO.
- and actually I removed global variable usage... sorry, I don't like globals.Now please, enjoy !
## get started
you need:
- docker with docker-composeThen create an `.env` file using none conflicting ports on your host:
```
NODE_API_PORT=3000
MONGO_PORT=27017
```## start
`$ docker-compose up --build`
I like using it without detaching option (`-d`), so I can keep looking on container outputs. It'i's up to you!
### create a todo
`$ curl -i -X POST "http://localhost:3000/todos" -H "Content-Type: application/json" -d '{"title" : "Restify rocks!"}'`
### get todos
`$ curl -i -X GET "http://localhost:3000/todos"`
## stop
`$ docker-compose down`
## license
[MIT](LICENSE)