-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.js
29 lines (20 loc) · 997 Bytes
/
server.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
/*
*@autor: Rio 3D Studios
*@description: java script server that works as master server of the Basic Example of WebGL Multiplayer Kit
*/
var express = require('express');//import express NodeJS framework module
var app = express();// create an object of the express module
var http = require('http').Server(app);// create a http web server using the http library
var io = require('socket.io')(http);// import socketio communication module
app.use("/public/TemplateData",express.static(__dirname + "/public/TemplateData"));
app.use("/public/Build",express.static(__dirname + "/public/Build"));
app.use(express.static(__dirname+'/public'));
//open a connection with the specific client
io.on('connection', function(socket){
//print a log in node.js command prompt
console.log('A user ready for connection!');
});//END_IO.ON
http.listen(process.env.PORT ||3000, function(){
console.log('listening on *:3000');
});
console.log("------- server is running -------");