feat(sql): full sql start stop and query with crash prevention
This commit is contained in:
@@ -8,7 +8,9 @@ import type { Express } from "express";
|
||||
import { apiReference } from "@scalar/express-api-reference";
|
||||
// const port = 3000;
|
||||
import type { OpenAPIV3_1 } from "openapi-types";
|
||||
|
||||
import { prodRestartSpec } from "../scaler/prodSqlRestart.spec.js";
|
||||
import { prodStartSpec } from "../scaler/prodSqlStart.spec.js";
|
||||
import { prodStopSpec } from "../scaler/prodSqlStop.spec.js";
|
||||
// all the specs
|
||||
import { statusSpec } from "../scaler/stats.spec.js";
|
||||
|
||||
@@ -21,7 +23,7 @@ export const openApiBase: OpenAPIV3_1.Document = {
|
||||
},
|
||||
servers: [
|
||||
{
|
||||
url: "http://localhost:3000",
|
||||
url: `http://localhost:3000${process.env.NODE_ENV?.trim() !== "production" ? "/lst" : "/"}`,
|
||||
description: "Development server",
|
||||
},
|
||||
],
|
||||
@@ -33,15 +35,15 @@ export const openApiBase: OpenAPIV3_1.Document = {
|
||||
bearerFormat: "JWT",
|
||||
},
|
||||
},
|
||||
schemas: {
|
||||
Error: {
|
||||
type: "object",
|
||||
properties: {
|
||||
error: { type: "string" },
|
||||
message: { type: "string" },
|
||||
},
|
||||
},
|
||||
},
|
||||
// schemas: {
|
||||
// Error: {
|
||||
// type: "object",
|
||||
// properties: {
|
||||
// error: { type: "string" },
|
||||
// message: { type: "string" },
|
||||
// },
|
||||
// },
|
||||
// },
|
||||
},
|
||||
tags: [
|
||||
// { name: "Health", description: "Health check endpoints" },
|
||||
@@ -57,6 +59,9 @@ export const setupApiDocsRoutes = (baseUrl: string, app: Express) => {
|
||||
...openApiBase,
|
||||
paths: {
|
||||
...statusSpec,
|
||||
...prodStartSpec,
|
||||
...prodStopSpec,
|
||||
...prodRestartSpec,
|
||||
|
||||
// Add more specs here as you build features
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user