Skip to content

DavOnGit/node-mongo-heroku-getting-started

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

80 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Website GitHub issues ![Gitter](https://badges.gitter.im/Join Chat.svg?style=flat-square) StackShare License

Express + MongoDB => Heroku getting started!

Build a barebones Node.js app using Express 4 and MongoDB.

 
This application is the merging of the following two articles: the Getting Started with Node on Heroku article and Building a Simple CRUD Application with Express and MongoDB article - check them out.

You can follow these articles as a step by step tutorial on the same app (if so it is recommended to follow first the 'Getting started...' and then 'Building a simple CRUD...' :)

Documentation

If you are following these articles as a tutorial then read this:

  • Follow the 'Getting started...' tutorial entirely but skip the last step ('Provision a database') because we will provide a MongoDB database via mLab.
  • Note in the first tutorial that the /views folder contain the /pages folder and the /partials folder, they both are used by EJS as templates to compose pages that share same header, navbar, footers and render server side content.
  • When you start the second tutorial remember to keep the same file structure inherited from the first one. This means that instead of create an index.html (that we already have but it is called index.ejs and is located in /views/pages/index.ejs) you have to create a second page called /db in /views/pages/db.ejs folder.

This app is live here: Website

For more information about using Node.js on Heroku or MongoDB or Express or EJS, see these articles and websites:

Running Locally

Make sure you have Node.js and the Heroku Toolbelt installed.

$ git clone https://github.com/DavOnGit/node-mongo-heroku-getting-started.git # or clone your own fork
$ cd node-mongo-heroku-getting-started
$ npm install
$ npm start

Your app should now be running on localhost:5000.

Deploying to Heroku

Deploy to Heroku

or

Make sure you have the Heroku Toolbelt installed.

$ heroku create
$ git push heroku master
$ heroku open

About

Getting Started with Node and MongoDB on Heroku

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HTML 68.4%
  • JavaScript 25.9%
  • CSS 5.7%