Multiple basePath entries for a single service #27244
madsgodvinjensen
started this conversation in
Ideas
Replies: 1 comment
-
+1 on this Our use case: we want to have one app instance but several localized base paths for different markets (EN, KZ, AZ, ...) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the feature you'd like to request
We are preparing to use Next.js to build a micro service/micro frontend architecture.
The plan is to host multiple independant ECS containers in AWS, all served by the same CloudFront distribution. There will be one domain name and each independant service will host one or more paths under that domain name.
The
basePath
/zones feature of Next.js is built just for that. We do see one issue that I'l like to enquire about and offer a potential solution for as well.The
basePath
is a single value which encourages the architecture to be divided by area of the website rather than by intended user flow for example. Either that, or change URLs to artificially pull things together that would benefit from being in the same service.We generally think of splitting services by user flow/funnel rather than organisational structure or URL. The benefits for the user will be that we can offer Next.js client side routing plus have a lot of JS chunks cached on the first request and the next in the funnel will be much much faster.
Describe the solution you'd like
Currently, we'd configure the basePath like this:
Would it be possible to specify this as an array of paths to listen for?
This would make it very flexible to structure the application by whatever need we might have rather than by how the URL scheme should be constructed, how our team structure is or similar that the users shouldn't have to pay for.
Describe alternatives you've considered
The two workarounds we're considering are:
Change our URL scheme to fit the user funnel
This is not great because it will have a large impact on the scope of the project. The URLs make sense as they are and changing them will impact SEO, links, bookmarks, support articles etc.
Create a lot more services than needed.
This impacts the cacheability as mentioned above, removes the option to use client side linking, and users will pay for it.
Beta Was this translation helpful? Give feedback.
All reactions