var http = require("http");

var express = require("express"),
    socketio = require("socket.io");

process.env.NODE_ENV = process.env.NODE_ENV || "development";
process.env.PORT = process.env.PORT || 8090;

var app = express(),
    server = http.Server(app),
    io = socketio(server);

app.set("root", __dirname);

require("./server/web")(app);
require("./server/socket")(io);

server.listen(process.env.PORT, function() {
  console.log("Listening on port " + process.env.PORT);
});
