MCPcopy
hub / github.com/prisma/prisma / startBunStudioServer

Function startBunStudioServer

packages/cli/src/studio-server.ts:105–130  ·  view source on GitHub ↗
({ handler, onListen, port }: StartStudioServerOptions)

Source from the content-addressed store, hash-verified

103}
104
105function startBunStudioServer({ handler, onListen, port }: StartStudioServerOptions): StudioServer {
106 const bun = (
107 globalThis as typeof globalThis & {
108 Bun?: {
109 serve(options: { fetch: StudioRequestHandler; port: number }): { stop(closeActiveConnections?: boolean): void }
110 }
111 }
112 ).Bun
113
114 if (!bun) {
115 throw new Error('Bun runtime is not available.')
116 }
117
118 const server = bun.serve({
119 fetch: handler,
120 port,
121 })
122
123 onListen()
124
125 return {
126 close() {
127 server.stop(true)
128 },
129 }
130}
131
132function startDenoStudioServer({ handler, onListen, port }: StartStudioServerOptions): StudioServer {
133 const abortController = new AbortController()

Callers 1

startStudioServerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected