Housekeeping workload and hours planning app — port of the WP hotel housekeeping hours calculator plugin. 7-day occupancy planner with Newbook PMS integration, staff rota, time requirements, and pickup tracking. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
24 lines
669 B
JavaScript
24 lines
669 B
JavaScript
import Fastify from 'fastify'
|
|
import cookie from '@fastify/cookie'
|
|
import cors from '@fastify/cors'
|
|
import { initDb } from './db.js'
|
|
import { bookingRoutes } from './routes/bookings.js'
|
|
import { configRoutes } from './routes/config.js'
|
|
|
|
const app = Fastify({ logger: true, trustProxy: true })
|
|
|
|
await app.register(cookie)
|
|
await app.register(cors, { origin: process.env.CORS_ORIGIN || false, credentials: true })
|
|
|
|
app.get('/health', async () => ({ status: 'healthy' }))
|
|
|
|
await app.register(bookingRoutes)
|
|
await app.register(configRoutes)
|
|
|
|
try {
|
|
await initDb()
|
|
await app.listen({ port: 3001, host: '0.0.0.0' })
|
|
} catch (err) {
|
|
app.log.error(err)
|
|
process.exit(1)
|
|
}
|