MCPcopy Index your code
hub / github.com/Sandpack/nodebox-runtime / setupApp

Function setupApp

internals/servers/utils.ts:5–23  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3import path from 'path';
4
5export function setupApp(): FastifyInstance {
6 if (process.env.CSB) {
7 return fastify({
8 logger: true,
9 });
10 }
11
12 const app = fastify({
13 logger: true,
14 https: {
15 key: fs.readFileSync(path.join(__dirname, '../../certificates/cert.key')),
16 cert: fs.readFileSync(path.join(__dirname, '../../certificates/cert.crt')),
17 },
18 });
19
20 app.log.level = process.env.NODE_ENV === 'test' ? 'error' : 'debug';
21
22 return app;
23}

Callers 7

preview-server.tsFile · 0.90
main-server.tsFile · 0.90
test-server.tsFile · 0.90
serve.tsFile · 0.90
runSandpackCDNProxyFunction · 0.90
runTestServerFunction · 0.90
constructorMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected