mirror of
https://github.com/zadam/trilium.git
synced 2026-01-17 03:54:24 +01:00
fix(server): server-side images not served in dev mode
This commit is contained in:
parent
2b8a7a28d9
commit
edfe23d88c
@ -39,7 +39,15 @@ async function register(app: express.Application) {
|
||||
root: clientDir,
|
||||
css: { devSourcemap: true }
|
||||
});
|
||||
app.use(`/${assetUrlFragment}/`, vite.middlewares);
|
||||
app.use(`/${assetUrlFragment}/`, (req, res, next) => {
|
||||
if (req.url.startsWith("/images/")) {
|
||||
// Images are served as static assets from the server.
|
||||
next();
|
||||
return;
|
||||
}
|
||||
|
||||
vite.middlewares(req, res, next);
|
||||
});
|
||||
app.get(`/`, [ rootLimiter, auth.checkAuth, csrfMiddleware ], (req, res, next) => {
|
||||
req.url = `/${assetUrlFragment}/src/index.html`;
|
||||
vite.middlewares(req, res, next);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user