Fork this template repository to get started with Node / Express.
Or follow the steps below to create your own:
- In Github Desktop: Choose File > New Repository
- Name: The name of your project, e.g.
sample-node-express-template
- Local Path: The directory on your computer where you keep your projects
- Create Readme: Yes
- Choose Repository > Open in Terminal
In Terminal...
# initialize NPM - just hit return for each of these for now
npm init
# install nodemon for development
npm install -g nodemon
# install project dependencies
npm install --save express express-handlebars node-fetch
# open in Atom
atom .
In Atom, add the following files from the source from this repository...
app/middleware.js
- Helper functions for your application stackapp/routes.js
- Organize all your routes in a single filepublic
- Directory with public sample assetsviews
- Directory with handlebar layout files.gitignore
- Tell git to ignore files.jshintrc
- Configuration file for JSHintapp.js
- Main app file, ties together all the middleware and modulespackage.json
- Update your ownstart
scripts from thisProcfile
- Tells Heroku how to startserver.js
- Loads the app and starts the file
- Start the app:
npm start
- Check that your app is running https://localhost:3000/
The following start options are also available
- Start in development mode (with nodemon --inspect)
npm run start-dev
- If you are using HTTPS locally (with nodemon --inspect)
npm run start-https
- Heroku status available at https://status.heroku.com/