Backend: code formatted

This commit is contained in:
2024-05-12 21:25:52 +02:00
parent fa25015472
commit bf791db47f
26 changed files with 574 additions and 469 deletions

View File

@ -1,14 +1,14 @@
import { Request, Response } from 'express';
import path from 'path';
import fs from 'fs';
import {Log} from 'nork'
import { Docs } from '../services/docsService';
import { Request, Response } from "express";
import path from "path";
import fs from "fs";
import { Log } from "nork";
import { Docs } from "../services/docsService";
new Docs('docs', 'get_all', '/api/v1', 'GET', 'Get docs json', undefined, undefined, 'docs json');
new Docs("docs", "get_all", "/api/v1", "GET", "Get docs json", undefined, undefined, "docs json");
export function docs_get(req: Request, res: Response) {
try {
res.json(JSON.parse(fs.readFileSync(path.join(__dirname, '../public/api.json')).toString()));
res.json(JSON.parse(fs.readFileSync(path.join(__dirname, "../public/api.json")).toString()));
} catch (err: any) {
res.status(500).json(Log.error(500, 'api.json docs file does not exists under public folder'));
res.status(500).json(Log.error(500, "api.json docs file does not exists under public folder"));
}
}