Skip to content

Instantly share code, notes, and snippets.

@KOBA789
Created October 5, 2010 12:02
Show Gist options
  • Save KOBA789/611438 to your computer and use it in GitHub Desktop.
Save KOBA789/611438 to your computer and use it in GitHub Desktop.
var fs = require("fs"),
connect = require("./lib/connect"),
ejs = require("./lib/ejs");
var templates = new Object();
function routing(app) {
app.get("/list", function(req, res){
var body = new String();
body = ejs.render("<%= test %>", {locals: {test: "あああ"}});
res.writeHead(200, {"Content-Type": "text/html"});
res.end(body, "utf8");
});
}
(function(){
fs.readdir("./template", function (err, files) {
});
var server = connect.createServer();
server.use(connect.logger({ buffer: true }));
server.use(connect.staticProvider({ root: __dirname + "/static", cache: true }));
//server.use("/users/", connect.router(user));
server.use(connect.router(routing));
server.listen(7080);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment