Skip to content

Instantly share code, notes, and snippets.

@ogt
Last active December 13, 2015 20:59
Show Gist options
  • Save ogt/4974301 to your computer and use it in GitHub Desktop.
Save ogt/4974301 to your computer and use it in GitHub Desktop.
> mkdir ~/Dropbox/Home/code/node/helloworld-js-heroku
> cd !$
> # add a minimal hello world app
> cat > index.html
<html>
<body>
hello world!!!
</body>
</html>
^D
> # add a minimal web server that needs no dependencies from
> cp ../helloworld/web.js .
> heroku login
> cat > package.json
{
"name": "node-example",
"version": "0.0.1",
"dependencies": {
},
"engines": {
"node": "0.8.x",
"npm": "1.1.x"
}
}
^D
> npm install
npm WARN package.json [email protected] No README.md file found!
> cat > README.md
Simplest possible hello world heroku node.js app
> npm install #note that no node_modules was added since we have no dependencies
> ls
/ README.md package.json
../ index.html web.js
>
> cat > Procfile
web: node web.js
^D
> foreman start
12:19:11 web.1 | started with pid 35582
12:19:11 web.1 | Server running at http://127.0.0.1:8000/
...
> open http://127.0.0.1:8000/
...
12:19:30 web.1 | /index.html
12:19:30 web.1 | /favicon.ico
^C
> cat > .gitignore
.*
!/.gitignore
^D
> git init
> git add .
> git commit -m "init"
> heroku create
Creating calm-taiga-3864... done, stack is cedar
http://calm-taiga-3864.herokuapp.com/ | [email protected]:calm-taiga-3864.git
Git remote heroku added
> git push heroku master
..... (lots of stuff)
http://calm-taiga-3864.herokuapp.com deployed to Heroku
To [email protected]:calm-taiga-3864.git
* [new branch] master -> master
> heroku ps:scale web=1
Scaling web processes... done, now running 1
> heroku open
....
> hub create -d 'hello world app in node.js for heroku'
github.com username: ogt
github.com password for ogt (never stored):
Updating origin
created repository: ogt/helloworld-js-heroku
> git push -u origin master
...
Total 11 (delta 2), reused 0 (delta 0)
To [email protected]:ogt/helloworld-js-heroku.git
* [new branch] master -> master
Branch master set up to track remote branch master from origin.
>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment