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

Function tenso

src/tenso.js:414–433  ·  view source on GitHub ↗
(userConfig = {})

Source from the content-addressed store, hash-verified

412 * @returns {Tenso} An initialized Tenso server instance
413 */
414export function tenso (userConfig = {}) {
415 const config = merge(clone(defaultConfig), userConfig);
416
417 if ((/^[^\d+]$/).test(config.port) && config.port < INT_1) {
418 console.error(INVALID_CONFIGURATION);
419 process.exit(INT_1);
420 }
421
422 config.webroot.root = resolve(config.webroot.root);
423 config.webroot.template = readFileSync(config.webroot.template, {encoding: UTF8});
424
425 if (config.silent !== true) {
426 config.defaultHeaders.server = `${config.title.toLowerCase()}/${config.version}`;
427 config.defaultHeaders[X_POWERED_BY] = `nodejs/${process.version}, ${process.platform}/${process.arch}`;
428 }
429
430 const app = new Tenso(config);
431
432 return app.init();
433}

Callers 15

sample.jsFile · 0.90
createTestServerFunction · 0.90
createHypermediaServerFunction · 0.90
parsers.jsFile · 0.90
createRateLimitedServerFunction · 0.90
createTestServerFunction · 0.90
serializers.jsFile · 0.90
createAuthServerFunction · 0.90
renderers.jsFile · 0.90
testServerLifecycleFunction · 0.90
testRequestProcessingFunction · 0.90

Calls 2

initMethod · 0.95
cloneFunction · 0.90

Tested by

no test coverage detected