Skip to content

Commit

Permalink
first files
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Sevilleja committed Oct 19, 2014
1 parent f2a0f2f commit a4dfc15
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 0 deletions.
12 changes: 12 additions & 0 deletions package.json
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"
}
}
2 changes: 2 additions & 0 deletions public/css/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
body { padding-top:50px; }
.container .jumbotron { border-radius:40px; }
23 changes: 23 additions & 0 deletions server.js
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);
});
24 changes: 24 additions & 0 deletions views/index.ejs
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>

0 comments on commit a4dfc15

Please sign in to comment.