Skip to content
Browse files

Setup server app to host files over 8080. Created Server.js

  • Loading branch information...
1 parent a232826 commit b279751566db87f8f409d2e4efe114a01c807a8b @a727891 committed Feb 2, 2013
Showing with 25 additions and 3 deletions.
  1. +1 −0 Server/Server.js
  2. +0 −3 Server/app.js
  3. +24 −0 app.js
View
1 Server/Server.js
@@ -0,0 +1 @@
+//Galaxies Server
View
3 Server/app.js
@@ -1,3 +0,0 @@
-/**
- * Node Application Server
- */
View
24 app.js
@@ -0,0 +1,24 @@
+/**
+ * Node Application Server
+ */
+var App = require('http').createServer(handler),
+ IO = require('socket.io').listen(App),
+ Static = require('node-static'); // for serving files
+
+// This will make all the files in the current folder accessible from the web
+var fileServer = new Static.Server('./Client');
+// This is the port for our web server. You will need to go to http://localhost:8080 to see it
+App.listen(8080);
+
+// If the URL of the socket server is opened in a browser
+function handler(request, response) {
+ request.addListener('end', function () {
+ fileServer.serve(request, response);
+ });
+}
+
+function main() {
+ console.log("Start Server...");
+}
+
+main();

0 comments on commit b279751

Please sign in to comment.
Something went wrong with that request. Please try again.