From a5f3b1488a77bf2463ebb7064c59281217a636f3 Mon Sep 17 00:00:00 2001 From: Andrew Calcutt Date: Sat, 20 Apr 2024 15:18:23 -0400 Subject: [PATCH] fix: add 'sprite/' to generated path So it doesn't conflict with style json url Signed-off-by: Andrew Calcutt --- src/serve_style.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/serve_style.js b/src/serve_style.js index 358dbb5..f52532c 100644 --- a/src/serve_style.js +++ b/src/serve_style.js @@ -56,7 +56,7 @@ export const serve_style = { return res.send(styleJSON_); }); - app.get('/:id/:name:scale(@[23]x)?.:format([\\w]+)', (req, res, next) => { + app.get('/:id/sprite/:name:scale(@[23]x)?.:format([\\w]+)', (req, res, next) => { const item = repo[req.params.id]; if (!item || !item.spritePaths) { @@ -170,7 +170,7 @@ export const serve_style = { path.relative(options.paths.sprites, path.dirname(styleFile)) ) ); - spriteItem.url = `local://styles/${id}/` + spriteName; + spriteItem.url = `local://styles/${id}/sprite/` + spriteName; spritePaths.push({id: spriteItem.id, name: spriteName, path: spritePath}); } }); @@ -186,7 +186,7 @@ export const serve_style = { path.relative(options.paths.sprites, path.dirname(styleFile)) ) ); - styleJSON.sprite = `local://styles/${id}/` + spriteName; + styleJSON.sprite = `local://styles/${id}/sprite/` + spriteName; spritePaths.push({id: 'default', name: spriteName, path: spritePath}); } }