Skip to content
Source
Sign inSign up
TanStack/ai
Open History to see the last commit

index.ts

21 lines474 Bytes

1import { serve } from '@hono/node-server'
2import { config as loadDotenv } from 'dotenv'
3import { fileURLToPath } from 'node:url'
4import { app } from './app'
5​
6loadDotenv({
7 path: fileURLToPath(new URL('../../.env', import.meta.url)),
8 quiet: true,
9})
10​
11const port = Number.parseInt(process.env.PORT ?? '8787', 10)
12​
13serve({
14 fetch: app.fetch,
15 hostname: '0.0.0.0',
16 port,
17})
18​
19console.log(
20 `TanStack AI React Native example server listening on http://0.0.0.0:${port}`,