Yep, you can import the file and return it (it'll be uploaded as a module) E.g. ```js import indexH

Yep, you can import the file and return it (it'll be uploaded as a module)

E.g.
import indexHtml from './pages/index.html';

export default {
  fetch(req) {
    const { pathname } = new URL(req.url);

    if (pathname === '/') {
      return new Response(indexHtml, { headers: { 'Content-Type': 'text/html' }});
    }

    return new Response('404 Not Found', { status: 404 });
  }
}

(Wrote on phone so won't be perfect)
Was this page helpful?