mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-11 23:04:52 +09:00
16 lines
387 B
JavaScript
16 lines
387 B
JavaScript
const fs = require("fs-extra")
|
|
const path = require("path")
|
|
|
|
module.exports = function(app){
|
|
app.get("/api/getPictures", async (req, res) => {
|
|
let pictures = (await fs.readdir(path.join(__dirname, `../../static/pictures`)))
|
|
.filter(path => path.includes(".png"))
|
|
.map(name => ({
|
|
name: name.replace(".png",""),
|
|
path: `/pictures/${name}`
|
|
}))
|
|
|
|
|
|
res.send(pictures)
|
|
})
|
|
} |