Skip to content

Commit 8b296dd

Browse files
committed
feat(klesia): add port override
1 parent 8fdaf93 commit 8b296dd

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

apps/klesia/.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
PORT=3000
12
MINA_NETWORK=devnet
23
NODE_API_DEVNET=https://api.minascan.io/node/devnet/v1/graphql
34
NODE_API_MAINNET=https://api.minascan.io/node/mainnet/v1/graphql

apps/klesia/src/index.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import "dotenv/config";
22
import { serve } from "@hono/node-server";
33
import { getConnInfo } from "@hono/node-server/conninfo";
4-
import { OpenAPIHono, createRoute } from "@hono/zod-openapi";
4+
import { OpenAPIHono, createRoute, z } from "@hono/zod-openapi";
55
import { PublicKeySchema } from "@mina-js/shared";
66
import { rateLimiter } from "hono-rate-limiter";
77
import { cors } from "hono/cors";
@@ -142,7 +142,12 @@ export const klesiaRpcRoute = api.openapi(rpcRoute, async ({ req, json }) => {
142142
.exhaustive();
143143
});
144144

145-
serve(api);
145+
serve(
146+
{ fetch: api.fetch, port: z.coerce.number().parse(process.env.PORT ?? 3000) },
147+
(info) => {
148+
console.log(`Listening on http://localhost:${info.port}`);
149+
},
150+
);
146151

147152
export type KlesiaRpc = typeof klesiaRpcRoute;
148153
export {

0 commit comments

Comments
 (0)