Created
December 6, 2012 04:14
-
-
Save hatched/4221727 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| npm install lactate |
This file contains hidden or 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 http = require('http'), | |
| port = 2424, | |
| lactate = require('lactate'), | |
| publicDir = lactate.dir('/public'); | |
| var server = http.createServer(function(req, res) { | |
| if (req.url === '/') { | |
| return publicDir.serve('index.html', req, res); | |
| } else { | |
| return publicDir.serve(req, res); | |
| } | |
| }); | |
| server.listen(port, function() { | |
| console.log('Listening on port', port); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment