How to use the http.Server function in http

To help you get started, we’ve selected a few http examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github AquiGorka / puppets / src / server / index.js View on Github external
"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);
github rtc-io / rtc-switchboard / examples / express.js View on Github external
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);
});
github steptools / NC.js / src / server / api_server.js View on Github external
_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 () { });
    });
  };
github Producters / express-crawler-snapshots / tests / testapp / server.js View on Github external
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/');
github ShankyTiwari / Realtime-Private-Chat-using-AngularJs-Nodejs-and-Mysql / server.js View on Github external
constructor(){
        this.port =  process.env.PORT || 3000;
        this.host = `localhost`;
        
        this.app = express();
        this.http = http.Server(this.app);
        this.socket = socketio(this.http);
    }

http

security holding package

Unknown
Latest version published 5 years ago

Package Health Score

47 / 100
Full package analysis