-
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
Showing
2 changed files
with
36 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,31 @@ | ||
// Use NPM to install expressjs and jade | ||
/* npm install express | ||
* In case it breaks, choose an earlier version, like: | ||
* npm install [email protected] | ||
* | ||
* npm install jade | ||
*/ | ||
|
||
// Set express module to variable "express" | ||
var express = require("express"); | ||
|
||
// Create an "app" variable from the express library | ||
var app = express(); | ||
|
||
// Set the app engine to use Jade as the template engine | ||
app.engine('jade', require('jade').__express); | ||
app.set('view engine', 'jade') | ||
|
||
// Set the template folder to be /public | ||
// Should ideally be in dedicated template fold | ||
app.set('views', __dirname + '/public'); | ||
|
||
// Add a "route" that leads to the req/res, as seen in Node.js | ||
app.get("/", function(req, res){ | ||
res.render("simpleJade", { title: "Page Title", message: "Jade Example"}); | ||
}); | ||
|
||
// Starts up the server | ||
var server = app.listen(1337, function() { | ||
|
||
}); |
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,5 @@ | ||
html | ||
head | ||
title!= title | ||
body | ||
h1!= message |