Created
December 19, 2010 17:22
-
-
Save szimek/747494 to your computer and use it in GitHub Desktop.
Script for serving static pages in a directory
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
| # Using Ruby with "rack" gem - run using "rackup" | |
| use Rack::Static, :urls => [""]; run nil |
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
| // Using NodeJS with "express" module - run using "node webserver.js" | |
| var sys = require("sys"), | |
| connect = require("connect"), | |
| express = require("express"); | |
| var port = 8080, | |
| app = express.createServer(); | |
| app.configure(function () { | |
| app.use(connect.staticProvider(__dirname + "/")); | |
| }); | |
| app.listen(port); | |
| sys.puts("Server running at http://0.0.0.0:" + port); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment