-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.ts
43 lines (37 loc) · 974 Bytes
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import { serve } from '@hono/node-server';
import donate from './donate/route';
import jupiterSwap from './jupiter-swap/route';
import heliusStake from './helius/stake/route';
import sanctumTrade from './sanctum/trade/route';
import tensorBuyFloor from './tensor/buy-floor/route';
import meteoraSwap from './meteora/swap/route';
import { cors } from 'hono/cors';
import { swaggerUI } from '@hono/swagger-ui';
import { OpenAPIHono } from '@hono/zod-openapi';
const app = new OpenAPIHono();
app.use('/*', cors());
app.route('/api/helius/stake', heliusStake);
app.doc('/doc', {
info: {
title: 'An API',
version: 'v1',
},
openapi: '3.1.0',
});
app.get(
'/swagger-ui',
swaggerUI({
url: '/doc',
}),
);
const port = 3000;
console.log(
`Server is running on port ${port}
Visit http://localhost:${port}/swagger-ui to explore existing actions
Visit https://actions.dialect.to to unfurl action into a Blink
`,
);
serve({
fetch: app.fetch,
port,
});