Koa.js To-Do API Demo
This is intended as a minimalist demonstration of a ToDo API written with Koa.js and Mongoose/MongoDB.
To get started, you will need the following...
- Node.js
7.x.x
or above. - Yarn though pure
npm
can work as well. - MongoDB
- Nodemon
- Optional but greatly helpful - Postman
Once you have all of items listed above, simply follow these directions.
- From the terminal,
git clone
the repository into your directory of choice. cd
in to the project's home directory and enteryarn install
.- Once the packages have installed, open up the project from your text editor of choice.
- Open
app.js
. - Inside
app.js
, look formongoose.connect
on lines 20 and 21. - Inside
mongoose.connect
, replace'/path/to/your/mongo'
with the Mongo database URI of your choice. Save the change. - From the terminal, enter
npm start
. The app should (hopefully) fire right up. - Open Postman, then import the
koa-demo.postman_collection.json
file. - You should be able to interact with the API with ease now.
- Enjoy!
One last note, I sincerely hope this ToDo API can be of help to anyone trying to gain an understanding of how to build things using Koa. Don't take what I do as the way to work. Anything you see is just a way to get the job done. That said, I hope this can be of some value to you. If something goes wrong, please feel free to let me know and I'll see what I can do.