How to add multiple pages in cloudflare worker sites

I am trying to work with cloudflare worker sites and wanted to add multiple pages and when i run

wrangler generate --site demo it created a folder where there is a public folder where all the static pages like index.html and 404.html exists and in the worker-sites there is index.js there in there the workers code but i don’t know what to do for creating a path like this on doamin xyz.com xyz.com/about xyz.com/create and many more

Wthin your /public/ folder, you should create a folder for each page you want to create on your website, and place there an HTML file named index.html.

So you have

/public/index.html < your example.com/ home page
/public/about/index.html < your example.com/about/ page
/public/create/index.html < your example.com/create/ page and so on.
etc.

For subdirectories, just place a folder within a folder, always leaving one index.html page for each path:

/public/about/index.html < your example.com/about/ page
/public/about/corporate/index.html < your example.com/about/corporate/ page
/public/about/press/index.html <your example.com/about/press/ page
etc.

2 Likes

but i wanted to know about when i create multiple folders and put index.html inside that then
i have to make changes in the worker-script/index.js file? and one more question how can i track the different-different files and make example.com/about example.com/contact after i add the index.html inside /public/about/index.html /public/contact/index.html