forked from m7mdharoun/heroku-node
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Chris Sevilleja
committed
Oct 19, 2014
1 parent
f2a0f2f
commit a4dfc15
Showing
4 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"name": "node-sample", | ||
"description": "Our sample Node to Heroku app", | ||
"main": "server.js", | ||
"scripts": { | ||
"start": "node server.js" | ||
}, | ||
"dependencies": { | ||
"ejs": "~1.0.0", | ||
"express": "~4.9.8" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
body { padding-top:50px; } | ||
.container .jumbotron { border-radius:40px; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
var express = require('express'); | ||
var app = express(); | ||
|
||
// set the port of our application | ||
// process.env.PORT lets the port be set by Heroku | ||
var port = process.env.PORT || 8080; | ||
|
||
// set the view engine to ejs | ||
app.set('view engine', 'ejs'); | ||
|
||
// make express look in the public directory for assets (css/js/img) | ||
app.use(express.static(__dirname + '/public')); | ||
|
||
// set the home page route | ||
app.get('/', function(req, res) { | ||
|
||
// ejs render automatically looks in the views folder | ||
res.render('index'); | ||
}); | ||
|
||
app.listen(port, function() { | ||
console.log('Our app is running on http://localhost:' + port); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>Node Sample App</title> | ||
|
||
<!-- CSS --> | ||
<!-- load bootstrap and our own personal stylesheet --> | ||
<link href="//maxcdn.bootstrapcdn.com/bootswatch/3.2.0/superhero/bootstrap.min.css" rel="stylesheet"> | ||
<link rel="stylesheet" href="css/style.css"> | ||
|
||
</head> | ||
<body> | ||
|
||
<div class="container"> | ||
<div class="jumbotron"> | ||
<h1>This Is Heroku Awesome!</h1> | ||
<p>This is the sample of a tutorial on <a href="http://scotch.io">scotch.io</a></p> | ||
<a href="http://scotch.io/tutorials/" class="btn btn-primary btn-lg">View the Tutorial</a> | ||
</div> | ||
</div> | ||
|
||
</body> | ||
</html> |