Skip to content

Commit

Permalink
Moved server.js to root.
Browse files Browse the repository at this point in the history
  • Loading branch information
matbee-eth committed Jun 15, 2012
1 parent 7d645d7 commit 711bd7b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 21 deletions.
2 changes: 1 addition & 1 deletion client/test.css
@@ -1,3 +1,3 @@
body {
background-color: yellow;
background-color: blue;
}
9 changes: 2 additions & 7 deletions client/test.js
@@ -1,9 +1,4 @@
var i = 0;
(function() {
window.server.Execute("Hello", ["one","two","three"], function (fail, one, two, three) {
console.log(one);
console.log(two);
console.log(three);
i++;
});
})();
console.log(i);
})();
18 changes: 7 additions & 11 deletions server/server.js → server.js
@@ -1,11 +1,11 @@
var express = require('express'), app = express.createServer(),
io = require('socket.io').listen(app);
var appS = require('./appserver');
var appS = require('./server/appserver');
var MemoryStore = express.session.MemoryStore,
sessionStore = new MemoryStore({ reapInterval: 60000 * 10 });

app.listen(8080);
app.use(express.static(__dirname + '/../client/'));
app.use(express.static(__dirname + '/client/'));
app.use(express.bodyParser());
app.use(express.methodOverride());
app.use(express.cookieParser());
Expand All @@ -23,9 +23,6 @@ app.get('/*', function (req, res) {
req.session.visitCount = req.session.visitCount ? req.session.visitCount + 1 : 1;
});

var parseCookie = require('connect').utils.parseCookie;


appServer = new appS.appserver(io);

// You're given an $ object with your appServer.Methods({}); functions.
Expand Down Expand Up @@ -61,8 +58,7 @@ appServer.Hook('change', '#inputElement', function (event) {
}
);
});

appServer.WatchFiles(__dirname + '/../client/index.html', function() {
appServer.WatchFiles(__dirname + '/client/index.html', function() {
// this.get(
// function() {

Expand All @@ -75,18 +71,18 @@ appServer.WatchFiles(__dirname + '/../client/index.html', function() {

});

appServer.WatchFiles(__dirname + '/../client/test.css', function() {
appServer.WatchFiles(__dirname + '/client/test.css', function() {

});

appServer.WatchFiles(__dirname + '/../client/test.js', function() {
appServer.WatchFiles(__dirname + '/client/test.js', function() {

});

appServer.WatchFiles(__dirname + '/../client/clientserver.js', function() {
appServer.WatchFiles(__dirname + '/client/clientserver.js', function() {

});

appServer.WatchFiles(__dirname + '/../client/test.template.html', function() {
appServer.WatchFiles(__dirname + '/client/test.template.html', function() {

});
4 changes: 2 additions & 2 deletions server/appserver.js
Expand Up @@ -162,8 +162,8 @@ var Server = function (io) {
for (var k in clients) {
var client = clients[k];
setTimeout(function() {
var file = fileName.replace(__dirname, "");
file = file.replace("../client/", "");
var file = fileName.replace('/client/', "/server/")
file = file.replace(__dirname, "");
if (fileName.substr(fileName.length-4) == ".css") {
self.ExecuteJavascript(client, function(fileName) {
$('link[rel="stylesheet"]').each(function () {
Expand Down

0 comments on commit 711bd7b

Please sign in to comment.