MCPcopy
hub / github.com/fosrl/pangolin / createNextServer

Function createNextServer

server/nextServer.ts:10–37  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

8const nextPort = config.getRawConfig().server.next_port;
9
10export async function createNextServer() {
11 // const app = next({ dev });
12 const app = next({
13 dev: process.env.ENVIRONMENT !== "prod",
14 turbopack: false
15 });
16 const handle = app.getRequestHandler();
17
18 await app.prepare();
19
20 const nextServer = express();
21
22 nextServer.use(stripDuplicateSesions);
23
24 nextServer.all("/{*splat}", (req, res) => {
25 const parsedUrl = parse(req.url!, true);
26 return handle(req, res, parsedUrl);
27 });
28
29 nextServer.listen(nextPort, (err?: any) => {
30 if (err) throw err;
31 logger.info(
32 `Dashboard Web UI server is running on http://localhost:${nextPort}`
33 );
34 });
35
36 return nextServer;
37}

Callers 1

startServersFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected