This commit is contained in:
metacryst
2026-03-10 19:45:49 -05:00
parent 042648512f
commit 5001b8203d
2 changed files with 1 additions and 20 deletions

View File

@@ -38,7 +38,6 @@ class Server {
/* Site */
router.post('/free', this.newUserSubmission)
router.get('/db/images/*', this.getUserImage)
router.get('/api/orgdata/*', this.getOrgData)
router.get('/api/mydata/*', this.getPersonalData)
router.get('/*', this.get)
@@ -135,25 +134,6 @@ class Server {
}
}
getUserImage = async (req, res) => {
function getFileByNumber(dir, number) {
const files = fs.readdirSync(dir);
const match = files.find(file => {
const base = path.parse(file).name; // filename without extension
return base === String(number);
});
return match ? path.join(dir, match) : null;
}
let filePath = path.join(this.DBPath, "images", path.basename(req.url))
if(filePath) {
res.sendFile(filePath)
} else {
return res.status(404).json({error: "Can't find image"})
}
}
get = async (req, res) => {
let url = req.url