MCPcopy Index your code
hub / github.com/Waishnav/devspace / serve

Function serve

src/cli.ts:169–206  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

167}
168
169async function serve(): Promise<void> {
170 const sqliteStatus = checkSqliteNative();
171 if (sqliteStatus !== "ok") {
172 throw new Error(
173 [
174 "better-sqlite3 could not load for this Node runtime.",
175 sqliteStatus,
176 "",
177 "Try reinstalling or rebuilding dependencies under the active Node version:",
178 " npm rebuild better-sqlite3",
179 ].join("\n"),
180 );
181 }
182
183 const { createServer } = await import("./server.js");
184 const config = loadConfig();
185 const { app, close } = createServer(config);
186 const httpServer = app.listen(config.port, config.host, () => {
187 console.log(`devspace listening on http://${config.host}:${config.port}/mcp`);
188 console.log(`public base url: ${config.publicBaseUrl}`);
189 console.log(`allowed roots: ${config.allowedRoots.join(", ")}`);
190 console.log(`allowed hosts: ${config.allowedHosts.join(", ")}`);
191 if (config.allowedHosts.includes("*")) {
192 console.warn("warning: Host header allowlist is disabled because DEVSPACE_ALLOWED_HOSTS=*");
193 }
194 console.log("auth: Owner password approval required");
195 console.log(`logging: ${config.logging.level} ${config.logging.format}`);
196 });
197
198 const shutdown = () => {
199 httpServer.close(() => {
200 close();
201 process.exit(0);
202 });
203 };
204 process.once("SIGINT", shutdown);
205 process.once("SIGTERM", shutdown);
206}
207
208async function runDoctor(): Promise<void> {
209 const files = loadDevspaceFiles();

Callers 1

mainFunction · 0.85

Calls 3

checkSqliteNativeFunction · 0.85
loadConfigFunction · 0.85
createServerFunction · 0.85

Tested by

no test coverage detected