diff --git a/.gitignore b/.gitignore
index e6989f6..6ea107d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,7 @@
node_modules
.idea
-public/
+!public/Config.js
+public
test/spec
assets/cards/*
client/scss/_cards.scss
@@ -11,4 +12,4 @@ client/scss/_cards.scss
/site/client/node_modules
/site/public/assets/js/bundle.js
/site/public/assets/css/app.css
-site/server/composer.lock
\ No newline at end of file
+site/server/composer.lock
diff --git a/Config.example.js b/Config.example.js
deleted file mode 100644
index 2cba948..0000000
--- a/Config.example.js
+++ /dev/null
@@ -1,16 +0,0 @@
-
-window.Config = {};
-
-Config.Server = {
- "hostname": "192.168.123.1",
- "port": 16918,
- secure: false
-}
-
-Config.Gwent = {
- notification_duration: 4000
-}
-
-Config.Site = {
- base: "/gwent-online/site/public"
-}
\ No newline at end of file
diff --git a/README.md b/README.md
index 56cd4ee..b84491e 100644
--- a/README.md
+++ b/README.md
@@ -7,12 +7,10 @@ Not-Gwent-Online is a standalone multiplayer version of Gwent, a card game from
##- Requirements
- [node.js](https://nodejs.org/) installed
- [GraphicsMagick](http://www.graphicsmagick.org) installed (for generating sprites)
-- Any Webserver like xampp, wamp, lamp etc
##- Build
-Make sure to clone the project in your webserver root folder, otherwise you won't be able to access your client later.
-The root folder is often called 'www' or 'htdocs', but depends on your installed webserver.
-```git
+
+```sh
cd ~/myWebserverRoot
git clone https://github.com/exane/not-gwent-online
cd not-gwent-online
@@ -24,13 +22,12 @@ npm run build
##- Config
- go to /public and open Config.js
- change hostname to your address. (e.g., "192.168.123.1")
Make sure you don't have a trailing slash after your IP or address. (e.g., "192.168.123.1/")
-- If you have to change the port then make sure you change the port on your server as well.
You find the server port in /server/server.js on line #18 "app.listen(#port)";
##- Start Server
-```
+```sh
cd ~/myProjectDirectory/not-gwent-online
node server/server.js
```
##- Start Client
-- Open your browser and go to "192.168.123.1/not-gwent-online/public" or wherever you saved your project.
+- Open your browser and go to e.g. "http://192.168.123.1:4000"
\ No newline at end of file
diff --git a/package.json b/package.json
index 28b24c1..0a59578 100644
--- a/package.json
+++ b/package.json
@@ -5,7 +5,7 @@
"main": "gulpfile.js",
"dependencies": {
"connect": "3.0.1",
- "express": "4.12.3",
+ "express": "^4.13.4",
"gulp-rename": "^1.2.2",
"jquery-deferred": "^0.3.0",
"minimist": "1.1.0",
diff --git a/public/Config.js b/public/Config.js
index cc374fe..6076be0 100644
--- a/public/Config.js
+++ b/public/Config.js
@@ -1,16 +1,32 @@
-window.Config = {};
+var Config = {};
Config.Server = {
- "hostname": "localhost",
- "port": 16918,
- secure: false
-}
+ "hostname": "127.0.0.1",
+ "port": 16918
+};
+
+Config.WebServer = {
+ "port": 3000
+};
Config.Gwent = {
notification_duration: 4000
-}
+};
-Config.Site = {
- base: "/gwent/site/public"
-}
\ No newline at end of file
+(function (name, definition){
+ if (typeof define === 'function'){ // AMD
+ define(definition);
+ } else if (typeof module !== 'undefined' && module.exports) { // Node.js
+ module.exports = definition();
+ } else { // Browser
+ var theModule = definition(), global = this, old = global[name];
+ theModule.noConflict = function () {
+ global[name] = old;
+ return theModule;
+ };
+ global[name] = theModule;
+ }
+})('Config', function () {
+ return Config;
+});
\ No newline at end of file
diff --git a/server/server.js b/server/server.js
index 6845dc9..be8f0c4 100644
--- a/server/server.js
+++ b/server/server.js
@@ -1,5 +1,8 @@
var argv = require('minimist')(process.argv.slice(2));
-
+var http = require("http");
+var express = require('express');
+var app = express();
+var Config = require("../public/Config")
global.connections = require("./Connections")();
@@ -9,17 +12,18 @@ global.Room = require("./Room");
global.User = require("./User");
-/*global.Socket = require("./Socket");*/
+var server = http.createServer(app);
+global.io = require("socket.io").listen(server);
+server.listen(Config.Server.port);
+app.use(express.static('public'));
+app.use('/public', express.static('public'));
+app.use('/assets', express.static('assets'));
-var app = require('http').createServer();
-global.io = require("socket.io")(app);
-
-app.listen(16918);
+app.listen(Config.WebServer.port);
var admin = io.of("/admin");
-
io.on("connection", function(socket) { //global connection
var user;
connections.add(user = User(socket));