Permalink
Browse files

Initial commit. Adds a very basic express/node static file server.

  • Loading branch information...
0 parents commit 751a7b2e0a4f88e5f2a49e1443429b0392deb77a @spadin committed Mar 28, 2011
Showing with 41 additions and 0 deletions.
  1. +12 −0 README.md
  2. +10 −0 public/index.html
  3. +19 −0 server.js
@@ -0,0 +1,12 @@
+Simple Express Static File Server
+=================================
+
+Description
+-----------
+
+A very simple static file server. For development use only.
+
+How to start:
+<pre>
+ > node server
+</pre>
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset=utf-8>
+ <title>Simple Express Static Server</title>
+</head>
+<body>
+
+</body>
+</html>
@@ -0,0 +1,19 @@
+var express = require("express"),
+ app = express.createServer();
+
+app.get("/", function(req, res) {
+ res.redirect("/index.html");
+});
+
+app.configure(function(){
+ app.use(express.methodOverride());
+ app.use(express.bodyParser());
+ app.use(express.static(__dirname + '/public'));
+ app.use(express.errorHandler({
+ dumpExceptions: true,
+ showStack: true
+ }));
+ app.use(app.router);
+});
+
+app.listen(4567);

0 comments on commit 751a7b2

Please sign in to comment.