Skip to content

Latest commit

 

History

History
41 lines (24 loc) · 1.51 KB

README.md

File metadata and controls

41 lines (24 loc) · 1.51 KB

hello-mongoose: Using Mongoose.js for elegant MongoDB object modeling in Node.js.

MongoDB and Node.js are often used together because of their shared use of Javascript and its Object Notation (JSON). Mongoose is a popular helper library that provides a more rigorous modeling environment for your data, enforcing a little bit more structure as needed, while still maintaining flexibility that makes MongoDB powerful. In this article, you make a connection to a hosted MongoDB instance at add-on provider MongoLab with Mongoose and model a simple object.

Deployment

To deploy the app to Heroku you can use the Heroku button Deploy or follow these steps:

  1. git clone git://github.com/mongolab/hello-mongoose.git && cd hello-mongoose
  2. heroku create
  3. heroku addons:add mongolab
  4. git push heroku master
  5. heroku open

Docker

The app can be debugged and tested using the Heroku Docker CLI plugin.

Make sure the plugin is installed:

heroku plugins:install heroku-docker

Configure Docker and Docker Compose:

heroku docker:init

And run the app locally:

docker-compose up

The app will now be available on the Docker daemon IP on port 8080.

You can also use Docker to release to Heroku:

heroku create
heroku docker:release
heroku open

License

MIT Licensed