This is the worker/index.js file - ``` import { Container } from "@cloudflare/containers"; export class MorphContainer extends Container { defaultPort = 8080; sleepAfter = "10s"; // Sleep after 10 seconds of inactivity enableInternet = true; // Environment variables will be set dynamically in the constructor // We can't access this.env here since it's not available at class definition time onStart() { console.log('Morph container successfully started'); } onStop() { console.log('Morph container successfully shut down'); } onError(error) { console.log('Morph container error:', error); } } export default { async fetch(request, env) { const url = new URL(request.url); // Route all API requests to the container if (url.pathname.startsWith('/api/')) { // Use a single container instance for all requests const containerInstance = env.MORPH_CONTAINER.idFromName("main"); const container = env.MORPH_CONTAINER.get(containerInstance); return await container.fetch(request); // // Set environment variables dynamically before starting the container // if (container.state === 'stopped') { // await container.start({ // envVars: { // MORPH_API_KEY: env.MORPH_API_KEY, // MORPH_BASE_URL: env.MORPH_BASE_URL, // BASE_SNAPSHOT_ID: env.BASE_SNAPSHOT_ID, // API_KEY: env.API_KEY, // UD_URL: env.UD_URL, // } // }); // } // // Forward the request to the container // return await container.fetch(request); } // Handle root path if (url.pathname === '/') { return new Response('Morph Server is running!', { status: 200, headers: { 'Content-Type': 'text/plain' } }); } // Handle health check if (url.pathname === '/health') { return new Response('OK', { status: 200, headers: { 'Content-Type': 'text/plain' } }); } return new Response('Not Found', { status: 404 }); }, }; ```