small
This commit is contained in:
@@ -38,7 +38,6 @@ class Server {
|
|||||||
|
|
||||||
/* Site */
|
/* Site */
|
||||||
router.post('/free', this.newUserSubmission)
|
router.post('/free', this.newUserSubmission)
|
||||||
router.get('/db/images/*', this.getUserImage)
|
|
||||||
router.get('/api/orgdata/*', this.getOrgData)
|
router.get('/api/orgdata/*', this.getOrgData)
|
||||||
router.get('/api/mydata/*', this.getPersonalData)
|
router.get('/api/mydata/*', this.getPersonalData)
|
||||||
router.get('/*', this.get)
|
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) => {
|
get = async (req, res) => {
|
||||||
|
|
||||||
let url = req.url
|
let url = req.url
|
||||||
|
|||||||
@@ -29,6 +29,7 @@
|
|||||||
--accent: rgb(57, 26, 0);
|
--accent: rgb(57, 26, 0);
|
||||||
--accent2: rgb(57, 26, 0);
|
--accent2: rgb(57, 26, 0);
|
||||||
--window: #ffc28b;
|
--window: #ffc28b;
|
||||||
|
--divider: rgb(205 152 76);
|
||||||
|
|
||||||
--house-src: /_/icons/house.svg;
|
--house-src: /_/icons/house.svg;
|
||||||
--nodes-src: /_/icons/nodes.svg;
|
--nodes-src: /_/icons/nodes.svg;
|
||||||
|
|||||||
Reference in New Issue
Block a user