The idea is to rewrite an existing php app in svelte but do it on a route-by-route basis. One constraint is that the new pages should have the same route as the old pages.
make will start a proxy on http://localhost, a legacy app (PHP) on http://localhost:81 and a next app (Svelte) on http://localhost:82. make dev will spin up a local development environment for the next app (Svelte) on http://localhost:3000.
^c at the terminal will stop the next app if you ran it via make dev.
make clean will stop the entire infrastructure if you ran make.
The idea is to add two more containers, one for a proxy and a another for the next app. The proxy will receive all incoming requests and have rules to determine whether to route a request the legacy app or the next app. This will all be transparent to the end user, i.e., the URL is not changed at all.
REMINDER: existing client SPA's might have routes that will need to be disabled.
The idea is to build the next app as a bundled SPA and drop its dist into a different directy on the existing app. Rules will then be written into the web server, i.e., mod_rewrite, that will serve the approprite resources from the appropriate directory, i.e., legacy requests from the legacy folder and migrated requests from the next app's folder.
REMINDER: existing client SPA's might have routes that will need to be disabled.
I'm not sure this is even a viable option since some of the existing routing of the legacy app is still in the client and would already have been bundled and delivered to the client.