Revert "12"

This reverts commit 2d4eee2950.
This commit is contained in:
Your Name committed 2026-08-06 04:52:21 +00:00
1 parent 2d4eee2950
commit 3a217f0dd0
81 files changed
+10766

No files matched your search

+34
View File
@@ -0,0 +1,34 @@
import Fastify from 'fastify'
import cors from '@fastify/cors'
import multipart from '@fastify/multipart'
import { config } from './config.js'
import { authRoutes } from './routes/auth.js'
import { cisesRoutes } from './routes/cises.js'
import { updRoutes } from './routes/upd.js'
import { plansRoutes } from './routes/plans.js'
const app = Fastify({ logger: true })
await app.register(cors, { origin: config.corsOrigin })
await app.register(multipart, {
limits: {
fileSize: 10 * 1024 * 1024,
files: 1,
},
throwFileSizeLimit: true,
})
await app.register(authRoutes)
await app.register(cisesRoutes)
await app.register(updRoutes)
await app.register(plansRoutes)
app.get('/health', async () => ({ status: 'ok', timestamp: new Date().toISOString() }))
try {
await app.listen({ port: config.port, host: config.host })
console.log(`Server running on http://${config.host}:${config.port}`)
} catch (err) {
app.log.error(err)
process.exit(1)
}