server.js
var http = require('http');
var express = require("express");
var app = express();
app.set("view engine", "vash");
app.get("/", function (req, res) {
res.render("index", { title: "Express+Vash" });
});
app.get("/api/users", function (req, res) {
res.set("Content-Type", "application/json");
res.send({ name: "Greg", isValid: true, group: "Admin" });
});
var port = process.env.port || 3000;
var server = http.createServer(app);
server.listen(port);
index,vash in view folder, VS2015 requires HTML tags to be upper case (see below)
<!DOCTYPE HTML>
<HTML>
<head>
<title>@model.title</title>
</head>
<BODY>
<div>@model.title</div>
</BODY>
</HTML>
No comments:
Post a Comment