forked from mde/ejs
-
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
1 parent
154a96c
commit a67445d
Showing
6 changed files
with
39 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
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
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 @@ | ||
<!-- Execute an exception --> | ||
<p><%= this_variable_is_not_defined %></p> |
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,3 @@ | ||
<head> | ||
<title><%= header %></title> | ||
</head> |
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,20 @@ | ||
<html> | ||
<head> | ||
<% include header.html %> | ||
</head> | ||
<body> | ||
<!-- | ||
Without fix result should be confusing | ||
ReferenceError: ./ejs/test/sample/index.html:2 | ||
1| <html> | ||
>> 2| <head> | ||
3| <% include header.html %> | ||
4| </head> | ||
5| <body> | ||
this_variable_is_not_defined is not defined | ||
--> | ||
<% include body.html %> | ||
</body> | ||
</html> |
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,11 @@ | ||
var express = require('express'), | ||
ejs = require('../../lib/ejs.js'); | ||
var app = express(); | ||
app.engine('.html', ejs.__express); | ||
app.set('view engine', 'ejs'); | ||
app.get('/', function(req, res) { | ||
res.render(__dirname + '/index.html', {header: 'Hello EJS'}); | ||
}); | ||
var server = app.listen(3000, function () { | ||
console.log('Example app listening at http://localhost:3000'); | ||
}); |