This is a Cloudflare "Workers & Pages" project.
You can set it up to publish on push to GitHub, or manually via pnpm run publish.
For each request, it will:
- If the equivalent path is in
public, it's served. Index files are served, e.g.public/foo/index.htmlwill be served for requests to/foo/. - Otherwise, if there's an equivalent route function (eg
/hello/will check forsrc/routes/hello/index.ts,/hello/barwill check forsrc/routes/hello/bar.ts), that file's default export is called to get the response. - Otherwise, if there's no
/at the end of the path, but there's an equivalentindex.tsif the path did end with a/, then it redirects. - Otherwise, 404.
public/_headers and public/_redirects are supported.
A root /index.html is generated, providing a list of top level URLs. Titles are 'scraped' from <title> in HTML, or // title: Hello! in route modules.
To install:
pnpm iTo dev:
pnpm run devTo deploy, push to GitHub, or:
pnpm run deployI guess npm will work too.