Skip to content

Commit 42fd929

Browse files
committed
fix: add debug logs to debug express 5 static files sharing
AdminForth/1781/image
1 parent 01cfa37 commit 42fd929

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

adminforth/servers/express.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,9 @@ class ExpressServer implements IExpressHttpServer {
224224
} else {
225225
const codeInjector = this.adminforth.codeInjector;
226226
this.expressApp.get(assetsRoute, (req, res) => {
227+
const fullPath = path.join(codeInjector.getServeDir(), replaceAtStart(req.url, prefix));
228+
console.log(`(2)Serving SPA index.html for ${req.url} from ${fullPath}`);
229+
console.log("(2)Exists:", fs.existsSync(fullPath));
227230
res.sendFile(
228231
path.join(codeInjector.getServeDir(), replaceAtStart(req.url, prefix)),
229232
{
@@ -254,6 +257,8 @@ class ExpressServer implements IExpressHttpServer {
254257
res.status(500).send(respondNoServer(`${this.adminforth.config.customization.brandName} is still warming up`, 'Please wait a moment...'));
255258
return;
256259
}
260+
console.log(`(1)Serving SPA index.html for ${req.url} from ${fullPath}`);
261+
console.log("(1)Exists:", fs.existsSync(fullPath));
257262
res.sendFile(fullPath, {
258263
cacheControl: false,
259264
headers: {

0 commit comments

Comments
 (0)