forked from brunosimon/asteroids
-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
31 lines (26 loc) · 934 Bytes
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Requires
var express = require( 'express' ),
http = require( 'http' ),
socket_io = require( 'socket.io' ),
path = require( 'path' ),
colors = require( 'colors' ),
Asteroids = require( './requires/game/asteroids.class.js' ),
get_network_ip = require( './requires/tools/get_network_ip.js' );
// Set up
var app = express(),
server = http.createServer( app );
// Static
app.use( express.static( path.join( __dirname, 'public' ) ) );
// Routes
app.get( '/', function( request, response )
{
response.send( 'pwet' );
} );
// Server
server.listen( 3000, function()
{
console.log( colors.green( '---------------------------' ) );
console.log( 'server'.green.bold + ' - ' + 'started'.cyan );
console.log( 'server'.green.bold + ' - ' + ( 'http://' + get_network_ip() + ':3000' ).cyan );
var game = new Asteroids( { server : server } );
} );