Permalink
Browse files

initial server build

requires express framework for node
  • Loading branch information...
1 parent 699ce68 commit 8b7d68b61fdb44d293f29091ad70ff0ad9460fd0 @ArkahnX committed May 27, 2012
Showing with 26 additions and 0 deletions.
  1. +2 −0 runServer.bat
  2. +8 −0 server/index.html
  3. +16 −0 server/server.js
View
@@ -0,0 +1,2 @@
+node %HOMEPATH%\Documents\GitHub\Biotech-Hunters\server\server.js
+pause
View
@@ -0,0 +1,8 @@
+<!doctype html>
+<html>
+<head>
+ <title>Biotech-Hunters.net Server</title>
+</head>
+<body>
+</body>
+</html>
View
@@ -0,0 +1,16 @@
+var express = require('express');
+var server = express.createServer();
+server.configure(function() {
+ server.use(express.static(__dirname + '/')).use(function(request, response, next) {
+ if(request.url === "404") {
+ var body = '404 test';
+ response.statusCode = 404;
+ response.setHeader('Content-Length', body.length);
+ response.end(body);
+ } else {
+ var body = 'my page';
+ response.setHeader('Content-Length', body.length);
+ response.end(body);
+ }
+ })
+}).listen(3000);

0 comments on commit 8b7d68b

Please sign in to comment.