feat: add menus (repas)
This commit is contained in:
parent
629f24811a
commit
1f8206ec88
3 changed files with 14 additions and 0 deletions
|
|
@ -26,6 +26,8 @@ services:
|
||||||
depends_on:
|
depends_on:
|
||||||
- redis
|
- redis
|
||||||
- postgres
|
- postgres
|
||||||
|
volumes:
|
||||||
|
- /home/nathan/khollise/menu/menus.json:/home/node/menus.json:ro
|
||||||
# Link env file
|
# Link env file
|
||||||
env_file:
|
env_file:
|
||||||
- ./prod.env
|
- ./prod.env
|
||||||
|
|
|
||||||
|
|
@ -73,4 +73,6 @@ export default await Env.create(new URL('../', import.meta.url), {
|
||||||
VAPID_PRIVATE_KEY: Env.schema.string(),
|
VAPID_PRIVATE_KEY: Env.schema.string(),
|
||||||
|
|
||||||
API_BEARER_TOKEN: Env.schema.string(),
|
API_BEARER_TOKEN: Env.schema.string(),
|
||||||
|
|
||||||
|
MENUS_PATH: Env.schema.string(),
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -74,3 +74,13 @@ router
|
||||||
router.get('/health', async () => {
|
router.get('/health', async () => {
|
||||||
return { status: 'ok' }
|
return { status: 'ok' }
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// BETA: Serve menus.json file
|
||||||
|
import fs from 'node:fs/promises'
|
||||||
|
import env from './env.js'
|
||||||
|
|
||||||
|
router.get('/menus', async () => {
|
||||||
|
// Return menus.json file
|
||||||
|
const data = await fs.readFile(env.get('MENUS_PATH'), 'utf-8')
|
||||||
|
return JSON.parse(data)
|
||||||
|
})
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue