2026-03-06 16:27:54 +00:00
|
|
|
import { serve } from '@hono/node-server'
|
|
|
|
|
import { app } from './app.js'
|
2026-03-07 10:42:18 +00:00
|
|
|
import { runMigrations } from './db/startup.js'
|
|
|
|
|
import { seedMockBots } from './engine/mock.js'
|
|
|
|
|
|
|
|
|
|
// Run migrations and seed mock bots before starting the server
|
|
|
|
|
runMigrations()
|
|
|
|
|
await seedMockBots()
|
2026-03-06 16:27:54 +00:00
|
|
|
|
|
|
|
|
const port = Number(process.env.PORT) || 9100
|
|
|
|
|
|
|
|
|
|
serve({ fetch: app.fetch, port }, () => {
|
|
|
|
|
console.log(`[botfights] server listening on http://localhost:${port}`)
|
|
|
|
|
})
|