Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/danielroe/nitro-vite-repros.
Something went wrong. Try again.
578 B · 18 lines
TypeScript
at basic
12345678910111213141516171819import { useRuntimeConfig } from 'nitro/runtime-config'import { render } from './renderer.ts'
export default { async fetch (request: Request): Promise<Response> { const url = new URL(request.url) const config = useRuntimeConfig() return new Response( [ `<!doctype html><meta charset="utf-8">`, `<h1>${url.pathname}</h1>`, `<pre>runtimeConfig=${JSON.stringify(config, null, 2)}</pre>`, `<pre>renderer=${await render()}</pre>`, ].join(''), { headers: { 'content-type': 'text/html; charset=utf-8' } }, ) },}