Simple node.js application that uses koajs and mongoose frameworks.
git clone
npm install
Application uses config.js
file for defining variables like port or database connection string.
Default port is set in package.json
in config section and can be overwritten by setting environment variable PORT
to another value:
set PORT=3003
npm start
- start application
npm test
- run tests
npm run watch
- start application using nodemon (require nodemon to be installed globally)
For simplification, new user is create just with id
parametr in request body. This id
is than used in routes.
POST /users
{
"id": "Martin"
}
POST /users/Martin/tweets
{
"tweet": "Hey hou"
}