├── views ├── avatars │ └── ianmalcolm │ │ ├── haron.txt │ │ └── 004.jpg └── index.ejs ├── public └── css │ └── style.css ├── README.md ├── package.json ├── server.js └── .gitignore /views/avatars/ianmalcolm/haron.txt: -------------------------------------------------------------------------------- 1 | test 2 | -------------------------------------------------------------------------------- /public/css/style.css: -------------------------------------------------------------------------------- 1 | body { padding-top:50px; } 2 | .container .jumbotron { border-radius:40px; } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | heroku-node 2 | =========== 3 | 4 | Code for the tutorial by @m7mdharon: Deploying Node Apps to Heroku 5 | -------------------------------------------------------------------------------- /views/avatars/ianmalcolm/004.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/e1abrador/heroku-node/master/views/avatars/ianmalcolm/004.jpg -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "node-sample", 3 | "description": "Our sample Node to Heroku app", 4 | "main": "server.js", 5 | "scripts": { 6 | "start": "node server.js" 7 | }, 8 | "dependencies": { 9 | "ejs": "~2.6.0", 10 | "express": "~4.9.8" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /views/index.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | PoC by e1abrador 5 | 6 | 7 | 8 |

PoC by e1abrador

9 | 10 | 11 | 12 | 13 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /server.js: -------------------------------------------------------------------------------- 1 | var express = require('express'); 2 | var app = express(); 3 | 4 | // set the port of our application 5 | // process.env.PORT lets the port be set by Heroku 6 | var port = process.env.PORT || 8080; 7 | 8 | // set the view engine to ejs 9 | app.set('view engine', 'ejs'); 10 | 11 | // make express look in the public directory for assets (css/js/img) 12 | app.use(express.static(__dirname + '/public')); 13 | 14 | // set the home page route 15 | app.get('/', function(req, res) { 16 | 17 | // ejs render automatically looks in the views folder 18 | res.render('index'); 19 | }); 20 | 21 | app.listen(port, function() { 22 | console.log('Our app is running on http://localhost:' + port); 23 | }); -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | 5 | # Runtime data 6 | pids 7 | *.pid 8 | *.seed 9 | 10 | # Directory for instrumented libs generated by jscoverage/JSCover 11 | lib-cov 12 | 13 | # Coverage directory used by tools like istanbul 14 | coverage 15 | 16 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 17 | .grunt 18 | 19 | # Compiled binary addons (http://nodejs.org/api/addons.html) 20 | build/Release 21 | 22 | # Dependency directory 23 | # Commenting this out is preferred by some people, see 24 | # https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git- 25 | node_modules 26 | 27 | # Users Environment Variables 28 | .lock-wscript 29 | --------------------------------------------------------------------------------