MCPcopy
hub / github.com/prisma/prisma / getIndexHtml

Function getIndexHtml

packages/cli/src/Studio.ts:428–459  ·  view source on GitHub ↗
(adapter: StudioAdapterType)

Source from the content-addressed store, hash-verified

426
427// prettier-ignore
428function getIndexHtml(adapter: StudioAdapterType): string {
429 return `<!doctype html>
430<html lang="en" style="height: 100%">
431 <head>
432 <meta charset="UTF-8" />
433 <meta name="viewport" content="width=device-width, initial-scale=1.0" />
434 <link rel="icon" href="${PRISMA_LOGO_SVG_DATA_URL}" type="image/svg+xml">
435 <link rel="stylesheet" href="/${STUDIO_CSS_FILE_NAME}">
436 <style>
437 html {
438 height: 100%;
439 }
440
441 body {
442 color: black;
443 height: 100%;
444 margin: 0;
445 padding: 0;
446 }
447
448 #root {
449 height: 100%;
450 }
451 </style>
452 </head>
453 <body>
454 <div id="root"></div>
455 <script>window.__STUDIO_CONFIG__ = ${JSON.stringify({ adapter })};</script>
456 <script type="module" src="/${STUDIO_JS_FILE_NAME}"></script>
457 </body>
458</html>`
459}
460
461function isGetOrHeadRequest(method: string): boolean {
462 return method === 'GET' || method === 'HEAD'

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected