Skip to content

Commit aa79875

Browse files
committed
fix: allow '.path/.pnpm/node_modules' like (with ',')filepath when return index.html
AdminForth/1781/image
1 parent 9aebe9e commit aa79875

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

adminforth/servers/express.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ class ExpressServer implements IExpressHttpServer {
225225
const codeInjector = this.adminforth.codeInjector;
226226
this.expressApp.get(assetsRoute, (req, res) => {
227227
const fullPath = path.join(codeInjector.getServeDir(), replaceAtStart(req.url, prefix));
228-
console.log(`(2)Serving SPA index.html for ${req.url} from ${fullPath}`);
228+
console.log(`(2)Serving SPA for ${req.url} from ${fullPath}`);
229229
console.log("(2)Exists:", fs.existsSync(fullPath));
230230
res.sendFile(
231231
path.join(codeInjector.getServeDir(), replaceAtStart(req.url, prefix)),
@@ -257,9 +257,8 @@ class ExpressServer implements IExpressHttpServer {
257257
res.status(500).send(respondNoServer(`${this.adminforth.config.customization.brandName} is still warming up`, 'Please wait a moment...'));
258258
return;
259259
}
260-
console.log(`(1)Serving SPA index.html for ${req.url} from ${fullPath}`);
261-
console.log("(1)Exists:", fs.existsSync(fullPath));
262260
res.sendFile(fullPath, {
261+
dotfiles: 'allow',
263262
cacheControl: false,
264263
headers: {
265264
'Content-Type': 'text/html',

0 commit comments

Comments
 (0)