import { Container } from '@cloudflare/containers' export class AppviewContainer extends Container { defaultPort = 8787 sleepAfter = '10m' } function healthResponse() { return new Response('ok\n', { status: 200, headers: { 'content-type': 'text/plain; charset=utf-8' }, }) } export default { async fetch(request, env) { const url = new URL(request.url) if (url.pathname === '/healthz') { return healthResponse() } const container = env.APPVIEW.getByName('atgit') await container.startAndWaitForPorts({ ports: 8787 }) return container.fetch(request) }, }