refactor: compose configurable geocoding and route services

This commit is contained in:
Sameh Khamis committed 2026-09-13 21:23:13 -07:00
1 parent 3b91feffdc
commit 8b36c28b06
25 files changed
+764 -211

No files matched your search

+2 -2
View File
@@ -59,7 +59,7 @@ function sendOverpassResponse(res, payload, cacheStatus = 'MISS') {
*
* @returns {import('vite').Plugin}
*/
function overpassProxy() {
function overpassProxy({ routing = {} } = {}) {
const installMiddleware = (server) => {
server.middlewares.use('/api/overpass', async (req, res) => {
// Hoisted out of the try so the catch's serve-stale lookup can see it
@@ -200,7 +200,7 @@ function overpassProxy() {
}
});
installRouteMiddleware(server.middlewares);
installRouteMiddleware(server.middlewares, routing);
};
return {
name: 'overpass-proxy',