mirror of
https://github.com/zadam/trilium.git
synced 2025-11-17 18:50:41 +01:00
fix(nx/docker): access to ETAPI
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -2,13 +2,13 @@ import type { Router } from "express";
|
||||
|
||||
import fs from "fs";
|
||||
import path from "path";
|
||||
import { RESOURCE_DIR } from "../services/resource_dir";
|
||||
|
||||
import { fileURLToPath } from "url";
|
||||
const specPath = path.join(path.dirname(fileURLToPath(import.meta.url)), "etapi.openapi.yaml");
|
||||
const specPath = path.join(RESOURCE_DIR, "etapi.openapi.yaml");
|
||||
let spec: string | null = null;
|
||||
|
||||
function register(router: Router) {
|
||||
router.get("/etapi/etapi.openapi.yaml", (req, res, next) => {
|
||||
router.get("/etapi/etapi.openapi.yaml", (_, res) => {
|
||||
if (!spec) {
|
||||
spec = fs.readFileSync(specPath, "utf8");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user