World map imported from the local game files (public DES key + gzip, read-only), 485 zones / 723 portal connections, BFS router with safe-only vs all-zones modes and danger counts, haul advisor ranking items by trip profit per carry weight, Travel page + game-path setting. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
24 lines
896 B
TypeScript
24 lines
896 B
TypeScript
import Fastify from 'fastify';
|
|
import { API_PORT } from './config.js';
|
|
import { getDb } from './db/index.js';
|
|
import { gamedataRoutes } from './routes/gamedata.js';
|
|
import { itemRoutes } from './routes/items.js';
|
|
import { marketRoutes } from './routes/market.js';
|
|
import { economyRoutes } from './routes/economy.js';
|
|
import { profileRoutes } from './routes/profiles.js';
|
|
import { travelRoutes } from './routes/travel.js';
|
|
|
|
const app = Fastify({ logger: { level: 'info' } });
|
|
|
|
getDb(); // initialize schema on startup
|
|
|
|
app.get('/api/health', async () => ({ ok: true }));
|
|
await app.register(gamedataRoutes);
|
|
await app.register(itemRoutes);
|
|
await app.register(marketRoutes);
|
|
await app.register(economyRoutes);
|
|
await app.register(profileRoutes);
|
|
await app.register(travelRoutes);
|
|
|
|
await app.listen({ port: API_PORT, host: '127.0.0.1' });
|
|
console.log(`API listening on http://127.0.0.1:${API_PORT}`);
|