polka

A Sapper-compatible setup to serve multiple apps from a single Express/Polka entry point

五迷三道 提交于 2021-02-07 12:45:15
问题 I need to set up a Polka (or Express) server so that it can serve multiple applications (one per hostname) from a single server.js entry point. It can be done using the vhost middleware (https://github.com/expressjs/vhost). Each app is exported as a middleware, and the one that corresponds to each request is added in the middleware chain in server.js . However, some (not all) of these apps will be Sapper applications so the setup must be compatible with Sapper. So far as I am aware, Sapper