Created
August 4, 2014 08:30
-
-
Save adammcarth/6039a65a9ea7b4a36019 to your computer and use it in GitHub Desktop.
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
// Require express to handle our http stuff later on. | |
var express = require("express"); | |
// Require EJS - our templating system for views. | |
var ejs = require("ejs"); | |
ejs.open = "<?"; | |
ejs.close = "?>"; // Use javascript in view files with <? ... ?> | |
// Express can be used under the `app` namespace. | |
var app = express(); | |
// Use static files in the "/public" directory. | |
app.use(express.static(path.join(__dirname, "public"))); | |
// Just some view stuff | |
app.set("views", path.join(__dirname, "views")); // Set views directory to "/views" | |
app.set("view engine", "ejs"); // Use EJS as our templating system. | |
// Initialize the server using node... | |
var server = app.listen(3000, function() { | |
console.log("Your blog is now running on port %d...", server.address().port); | |
}); | |
// Fire up the server when this file is executed. | |
module.exports = server; |
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
{ | |
"name": "NodexBook", | |
"description": "My snazzy new blog built with Node, Express and Bookshelf.", | |
"dependencies": { | |
"express": "4.6.1", | |
"ejs": "1.0.0", | |
"strftime": "0.8.1", | |
"knex": "0.6.22", | |
"bookshelf": "0.7.7", | |
"sqlite3": "2.2.4" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment