Connect frontend to oRPC server

- Add Vite proxy to forward /api/v1/rpc to API server (port 9861)
- Create oRPC client in src/lib/api/client.ts
- Add @orpc/client and @orpc/contract dependencies
- Add @reviq/api-contract workspace dependency
- Extract DEFAULT_PORT constant to api-server/src/constants.ts
- Change API server default port from 3001 to 9861

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
RevIQ
2026-01-09 12:09:03 +08:00
parent bd3997ffe9
commit 2e9ea74bc9
9 changed files with 36 additions and 1 deletions

View File

@@ -0,0 +1,4 @@
/**
* Default port for the API server
*/
export const DEFAULT_PORT = 9861;

View File

@@ -1,9 +1,10 @@
import { RPCHandler } from "@orpc/server/fetch";
import { DEFAULT_PORT } from "./constants.js";
import { router } from "./router.js";
const handler = new RPCHandler(router);
const port = import.meta.env.PORT ?? 3001;
const port = import.meta.env.PORT ?? DEFAULT_PORT;
Bun.serve({
port,