feat: wire hono app and start server
This commit is contained in:
parent
c16d028983
commit
19fa4f1fcb
1 changed files with 13 additions and 1 deletions
14
src/index.ts
14
src/index.ts
|
|
@ -1,3 +1,15 @@
|
||||||
|
import { serve } from '@hono/node-server'
|
||||||
|
import { Hono } from 'hono'
|
||||||
|
import { health } from '@/routes/health.js'
|
||||||
|
import { miniapp } from '@/routes/miniapp.js'
|
||||||
|
import { sync } from '@/routes/sync.js'
|
||||||
import { config } from '@/shared/config.js'
|
import { config } from '@/shared/config.js'
|
||||||
|
|
||||||
console.log(`starting in ${config.mode} mode...`)
|
const app = new Hono()
|
||||||
|
app.route('/', health)
|
||||||
|
app.route('/', miniapp)
|
||||||
|
app.route('/', sync)
|
||||||
|
|
||||||
|
serve({ fetch: app.fetch, port: config.port }, ({ port }) => {
|
||||||
|
console.log(`arcanesync listening on :${port} (${config.mode})`)
|
||||||
|
})
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue