build(api): bundle the api instead of transpiling at boot (#2227)

This commit is contained in:
Hampus authored and GitHub committed 2026-08-31 01:26:30 +02:00
1 parent ba54b61dcf
commit 5f6f9428ac
11 files changed
+197 -30

No files matched your search

@@ -1,14 +1,13 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
import * as fs from 'node:fs';
import * as path from 'node:path';
import {fileURLToPath} from 'node:url';
import type {Hono} from 'hono';
import {RateLimitMiddleware} from '../middleware/RateLimitMiddleware';
import {RateLimitConfigs} from '../RateLimitConfig';
import type {HonoEnv} from '../types/HonoEnv';
import {resolveAssetPath} from '../utils/AssetPaths';
const SPEC_PATH = path.join(path.dirname(fileURLToPath(import.meta.url)), 'openapi.json');
const SPEC_PATH = resolveAssetPath('openapi', 'openapi.json');
const SPEC_BODY = fs.readFileSync(SPEC_PATH, 'utf-8');
export function OpenAPIController(app: Hono<HonoEnv>): void {