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 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 home page
/public/about/index.html < your page
/public/create/index.html < your page and so on.

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

/public/about/index.html < your page
/public/about/corporate/index.html < your page
/public/about/press/index.html <your page


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 after i add the index.html inside /public/about/index.html /public/contact/index.html

This topic was automatically closed after 31 days. New replies are no longer allowed.