Created
October 5, 2010 12:02
-
-
Save KOBA789/611438 to your computer and use it in GitHub Desktop.
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
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