Skip to content
This repository has been archived by the owner on Feb 4, 2024. It is now read-only.

Commit

Permalink
Try to fix images
Browse files Browse the repository at this point in the history
  • Loading branch information
alvarorg14 committed Apr 29, 2022
1 parent b2bb325 commit 397877c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions restapi/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ app.get(["/*.png", "/undefined"], function (req, res) {
const a = path.join(__dirname, "public", "not-found.png");
const ipath = path.join(__dirname, "public", req.originalUrl);
const savePath = path.resolve(ipath);
console.log(req.originalUrl);
console.log(ipath);
console.log(savePath);

if (savePath.startsWith(__dirname + "\\public") && fs.existsSync(savePath)) {
res.sendFile(savePath);
Expand Down

0 comments on commit 397877c

Please sign in to comment.