Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
"use strict";
var express = require('express');
var server = express();
var http = require('http').Server(server);
var PORT = 8000;
// socket server
http.listen(PORT);
// http server
server.use(express.static(__dirname + '/../../'));
//
console.log('Server ON : *:' + PORT);
var express = require('express');
var app = express();
var server = require('http').Server(app);
var port = process.env.PORT || 3000;
// create the switchboard
var switchboard = require('..')(server);
server.listen(port, function(err) {
if (err) {
return;
}
console.log('server listening on port: ' + port);
});
_setSocket(){
// Socket server
this.server = http.Server(this.express);
this.ioServer = io(this.server, {});
this.ioServer.use(ioSession(this.session));
this.ioServer.on('connection', function (socket) {
socket.on('disconnect', function () { });
});
};
var getApp = require('./app'),
http = require('http'),
middleware = require('../../index');
var app = getApp(middleware({
maxInstances: 1
}));
server = http.Server(app);
server.listen(3000);
console.log('server started at http://localhost:3000/');
constructor(){
this.port = process.env.PORT || 3000;
this.host = `localhost`;
this.app = express();
this.http = http.Server(this.app);
this.socket = socketio(this.http);
}