MCPcopy Create free account
hub / github.com/avoidwork/tenso / start

Method start

src/tenso.js:374–392  ·  view source on GitHub ↗

* Starts the HTTP or HTTPS server * @returns {Tenso} The Tenso instance for method chaining

()

Source from the content-addressed store, hash-verified

372 * @returns {Tenso} The Tenso instance for method chaining
373 */
374 start () {
375 if (this.server === null) {
376 if (this.ssl.cert === null && this.ssl.pfx === null && this.ssl.key === null) {
377 this.server = http.createServer(this.route).listen(this.port, this.host);
378 } else {
379 this.server = https.createServer({
380 cert: this.ssl.cert ? readFileSync(this.ssl.cert) : void INT_0,
381 pfx: this.ssl.pfx ? readFileSync(this.ssl.pfx) : void INT_0,
382 key: this.ssl.key ? readFileSync(this.ssl.key) : void INT_0,
383 port: this.port,
384 host: this.host
385 }, this.route).listen(this.port, this.host);
386 }
387
388 this.log(`Started server on ${this.host}:${this.port}`);
389 }
390
391 return this;
392 }
393
394 /**
395 * Stops the server

Callers 4

sample.jsFile · 0.80
testRequestResponseFunction · 0.80
startServerFunction · 0.80
testServerLifecycleFunction · 0.80

Calls 1

logMethod · 0.80

Tested by

no test coverage detected