MCPcopy Index your code
hub / github.com/ember-cli/ember-cli / setupHttpServer

Method setupHttpServer

lib/tasks/server/express-server.js:43–62  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

41 }
42
43 setupHttpServer() {
44 if (this.startOptions.ssl) {
45 this.httpServer = this.createHttpsServer();
46 } else {
47 this.httpServer = this.http.createServer(this.app);
48 }
49
50 // We have to keep track of sockets so that we can close them
51 // when we need to restart.
52 this.sockets = {};
53 this.nextSocketId = 0;
54 this.httpServer.on('connection', (socket) => {
55 let socketId = this.nextSocketId++;
56 this.sockets[socketId] = socket;
57
58 socket.on('close', () => {
59 delete this.sockets[socketId];
60 });
61 });
62 }
63
64 createHttpsServer() {
65 if (!fs.existsSync(this.startOptions.sslKey)) {

Callers 1

startHttpServerMethod · 0.95

Calls 3

createHttpsServerMethod · 0.95
createServerMethod · 0.80
onMethod · 0.45

Tested by

no test coverage detected