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
7 changed files
with
91 additions
and
7 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
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,16 @@ | ||
var express = require('express'); | ||
var app = express(); | ||
var port = process.env.port || 1337; | ||
var KallyRazor = require('../../lib/main'); | ||
|
||
app.use(express.static(__dirname + '/public')); | ||
app.get('/', function(req, res) { | ||
var razor = KallyRazor({ root: __dirname, layout: 'views/_Layout.cshtml' , baseUrl:''}); | ||
var result = razor.render('views/index.html', { | ||
name: 'My Test Name', | ||
}); | ||
res.send(result); | ||
}); | ||
|
||
app.listen(port); | ||
console.log('Listening on port ' + 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,7 @@ | ||
{ | ||
"name": "KallyRazor_Sample_1", | ||
"version": "1.0.0", | ||
"dependencies": { | ||
"express" : "3.x" | ||
} | ||
} |
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 @@ | ||
@{ layout = null; } | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<title>@ViewBag.Title</title> | ||
</head> | ||
<body> | ||
@renderBody() | ||
@renderSection("scripts") | ||
</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,10 @@ | ||
@{ | ||
ViewBag.Title = "Sample page title"; | ||
} | ||
@section scripts{ | ||
<script type="text/javascript" src="@Url.Content("~/script.js")"></script> | ||
} | ||
|
||
<img src="@Url.Content("~/logo.png")" /> | ||
Welcome, @model.name! Hope you enjoy the samples! | ||
|