Hey guys, I have a question.
Hey guys, I have a question.
I have a nextjs static site, all HTML, js and css. No server side rendering.
I want to have the nextjs app generate a bunch of static "websites" for different clients.
Then (I'm not sure if I can do this) I want to intercept all the request to the pages IP and based on the host, fetch the correct ASSETS.
Imagine: client1.com -> Pages Function -> Retrieve static file from ASSETS/client1/index.html
I'm trying to work with the
_worker.js
file, but it seems that cloudflare is not picking it.
Can anyone help, plz? ๐3 Replies
tree (this is just a sample nextjs website)
why _worker.js? you can add a _middleware to handle your use case
Middleware ยท Cloudflare Pages docs
Middleware is reusable logic that can be run before your onRequest function. Middlewares are typically utility functions. Error handling, user โฆ