Remove @mui, move states into zustand store

This commit is contained in:
cracklesparkle
2024-12-10 10:51:29 +09:00
parent e9595f9703
commit eeae97288a
27 changed files with 537 additions and 2079 deletions

View File

@ -0,0 +1,24 @@
import express, { Request, Response } from 'express';
import path from 'path';
import fs from 'fs';
const router = express.Router()
const tileFolder = path.join(__dirname, '..', '..', '..', 'public', 'static')
router.get('/:city_id', async (req: Request, res: Response) => {
const { city_id } = req.params
const tilePath1 = path.join(tileFolder, `${city_id}.jpg`)
const tilePath2 = path.join(tileFolder, `${city_id}.png`)
if (fs.existsSync(tilePath1)) {
return res.sendFile(tilePath1)
} else if (fs.existsSync(tilePath2)) {
return res.sendFile(tilePath2)
} else {
res.status(404).send('Tile is not generated or not provided')
}
})
export default router