Skip to content

Latest commit

 

History

History
69 lines (51 loc) · 2 KB

README.md

File metadata and controls

69 lines (51 loc) · 2 KB

node-js-sample (debian package)

A barebones Node.js app using Express 4.

This fork of a basic node app from heroku demonstrates of how to package node apps and have them run as a service. This approach sould not interfere with npm and the standard ways developers like to work on these things.

It also aims to be minimalistic in nature and only depend on v8 and node for deployment into raw, virtuale, or namespaces (containers). It really doesn't matter since its a package.

Simply:

debuild

Now you can deploy the binary wherever you have debian.

$ sudo dpkg -i ../node-js-sample*_all.deb

$ curl -I localhost:5000
HTTP/1.1 200 OK
X-Powered-By: Express
Content-Type: text/html; charset=utf-8
Content-Length: 12
ETag: W/"c-1c291ca3"
Date: Sat, 17 Jan 2015 20:12:53 GMT
Connection: keep-alive

$ curl localhost:5000
Hello World!

Running Locally

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

git clone [email protected]:heroku/node-js-sample.git # or clone your own fork
cd node-js-sample
npm install
npm start

Your app should now be running on localhost:5000.

Deploying to Heroku

heroku create
git push heroku master
heroku open

Alternatively, you can deploy your own copy of the app using this experimental web-based flow:

Deploy to Heroku

Documentation

For more information about using Node.js on Heroku, see these Dev Center articles: