mirror of
https://github.com/OneUptime/oneuptime.git
synced 2026-04-06 00:32:12 +02:00
make api docs work.
This commit is contained in:
@@ -0,0 +1 @@
|
||||
PORT=1445
|
||||
@@ -0,0 +1 @@
|
||||
PORT={{ .Env.API_DOCS_PORT }}
|
||||
@@ -4,9 +4,12 @@ import Express, {
|
||||
ExpressResponse,
|
||||
ExpressStatic,
|
||||
} from 'CommonServer/Utils/Express';
|
||||
|
||||
import logger from 'CommonServer/Utils/Logger';
|
||||
import App from 'CommonServer/Utils/StartServer';
|
||||
import path from 'path';
|
||||
|
||||
const APP_NAME: string = 'api-docs';
|
||||
|
||||
const app: ExpressApplication = Express.getExpressApp();
|
||||
|
||||
// Set the view engine to ejs
|
||||
@@ -26,4 +29,17 @@ app.get(['/', '/docs'], (_req: ExpressRequest, res: ExpressResponse) => {
|
||||
res.render('pages/index');
|
||||
});
|
||||
|
||||
const init: Function = async (): Promise<void> => {
|
||||
try {
|
||||
// init the app
|
||||
await App(APP_NAME);
|
||||
|
||||
} catch (err) {
|
||||
logger.error('App Init Failed:');
|
||||
logger.error(err);
|
||||
}
|
||||
};
|
||||
|
||||
init();
|
||||
|
||||
export default app;
|
||||
|
||||
@@ -1,46 +1,55 @@
|
||||
{
|
||||
"name": "api-docs",
|
||||
"name": "oneuptime-homepage",
|
||||
"version": "3.0.0",
|
||||
"description": "oneuptime api refernce",
|
||||
"main": "Gruntfile.js",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/OneUptime/ApiDocs.git"
|
||||
},
|
||||
"author": "OneUptime Limited.",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/oneuptime/ApiDocs/issues"
|
||||
},
|
||||
"homepage": "https://github.com/oneuptime/ApiDocs#readme",
|
||||
"type": "module",
|
||||
"dependencies": {
|
||||
"chai": "^4.3.6",
|
||||
"chai-http": "^4.3.0",
|
||||
"Common": "file:../Common",
|
||||
"CommonServer": "file:../CommonServer",
|
||||
"cors": "^2.8.5",
|
||||
"cross-env": "^7.0.3",
|
||||
"ejs": "^3.1.6",
|
||||
"express": "^4.17.3",
|
||||
"mocha": "^9.2.2",
|
||||
"Model": "file:../Model",
|
||||
"path": "^0.12.7",
|
||||
"ts-node": "^10.9.1"
|
||||
},
|
||||
"scripts": {
|
||||
"preinstall": "npx npm-force-resolutions || echo 'No package-lock.json file. Skipping force resolutions'",
|
||||
"start": "node --require ts-node/register Index.ts",
|
||||
"compile": "tsc",
|
||||
"dev": "npx nodemon",
|
||||
"test": "jest"
|
||||
"test": "jest",
|
||||
"lighthouse-test": "jest --forceExit lighthouse-tests/test/index.test.js --env=node",
|
||||
"lighthouse": "start-server-and-test http://localhost:1444",
|
||||
"smoketest": "jest --forceExit smoketest/index.test.js --env=node",
|
||||
"audit": "npm audit --audit-level=low",
|
||||
"light-house": "node lighthouse.js --web",
|
||||
"light-house-mobile": "node lighthouse.js --mobile",
|
||||
"dep-check": "depcheck ./ --skip-missing=true --ignores='ejs,puppeteer'"
|
||||
},
|
||||
"dependencies": {
|
||||
"@types/body-parser": "^1.19.2",
|
||||
"@types/cli-table": "^0.3.0",
|
||||
"@types/compression": "^1.7.2",
|
||||
"@types/ejs": "^3.1.1",
|
||||
"@types/minify": "^8.0.0",
|
||||
"@types/try-to-catch": "^3.0.0",
|
||||
"axios": "^0.26.1",
|
||||
"body-parser": "^1.19.2",
|
||||
"cli-table": "^0.3.11",
|
||||
"Common": "file:../Common",
|
||||
"CommonServer": "file:../CommonServer",
|
||||
"compression": "^1.7.4",
|
||||
"ejs": "^3.1.8",
|
||||
"express": "^4.18.1",
|
||||
"Model": "file:../Model",
|
||||
"ts-node": "^10.9.1",
|
||||
"xmlbuilder2": "^3.0.2"
|
||||
},
|
||||
"resolutions": {},
|
||||
"devDependencies": {
|
||||
"@types/jest": "^27.5.1",
|
||||
"@types/node": "^17.0.22",
|
||||
"chrome-launcher": "^0.15.0",
|
||||
"commander": "^9.1.0",
|
||||
"depcheck": "^1.4.3",
|
||||
"jest": "^28.1.0",
|
||||
"lighthouse": "^9.5.0",
|
||||
"nodemon": "^2.0.20",
|
||||
"npm-force-resolutions": "0.0.10",
|
||||
"ts-node-dev": "^1.1.8"
|
||||
"ora": "^6.1.0",
|
||||
"puppeteer": "^13.5.1",
|
||||
"start-server-and-test": "^1.14.0",
|
||||
"ts-jest": "^28.0.2",
|
||||
"ts-node-dev": "^1.1.8",
|
||||
"typescript": "^4.6.4"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
"target": "es2017" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
|
||||
// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
|
||||
"jsx": "react" /* Specify what JSX code is generated. */,
|
||||
"experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */
|
||||
"emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
|
||||
"experimentalDecorators": true /* Enable experimental support for TC39 stage 2 draft decorators. */,
|
||||
"emitDecoratorMetadata": true /* Emit design-type metadata for decorated declarations in source files. */,
|
||||
// "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h' */
|
||||
// "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
|
||||
// "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using `jsx: react-jsx*`.` */
|
||||
@@ -31,16 +31,19 @@
|
||||
// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
|
||||
|
||||
/* Modules */
|
||||
"module": "es2022" /* Specify what module code is generated. */,
|
||||
"rootDir": "", /* Specify the root folder within your source files. */
|
||||
"moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */
|
||||
// "module": "es2022" /* Specify what module code is generated. */,
|
||||
// "rootDir": "./", /* Specify the root folder within your source files. */
|
||||
"moduleResolution": "node" /* Specify how TypeScript looks up a file from a given module specifier. */,
|
||||
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
|
||||
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
|
||||
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
|
||||
"typeRoots": [
|
||||
|
||||
], /* Specify multiple folders that act like `./node_modules/@types`. */
|
||||
"types": ["node"], /* Specify type package names to be included without being referenced in a source file. */
|
||||
"./node_modules/@types"
|
||||
] /* Specify multiple folders that act like `./node_modules/@types`. */,
|
||||
"types": [
|
||||
"node",
|
||||
"jest"
|
||||
] /* Specify type package names to be included without being referenced in a source file. */,
|
||||
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
|
||||
// "resolveJsonModule": true, /* Enable importing .json files */
|
||||
// "noResolve": true, /* Disallow `import`s, `require`s or `<reference>`s from expanding the number of files TypeScript should add to a project. */
|
||||
@@ -54,9 +57,9 @@
|
||||
// "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
|
||||
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
|
||||
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
|
||||
"sourceMap": true, /* Create source map files for emitted JavaScript files. */
|
||||
"sourceMap": true /* Create source map files for emitted JavaScript files. */,
|
||||
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output. */
|
||||
"outDir": "build/dist", /* Specify an output folder for all emitted files. */
|
||||
"outDir": "./build/dist" /* Specify an output folder for all emitted files. */,
|
||||
// "removeComments": true, /* Disable emitting comments. */
|
||||
// "noEmit": true, /* Disable emitting files from a compilation. */
|
||||
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
|
||||
@@ -84,22 +87,22 @@
|
||||
|
||||
/* Type Checking */
|
||||
"strict": true /* Enable all strict type-checking options. */,
|
||||
"noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied `any` type.. */
|
||||
"strictNullChecks": true, /* When type checking, take into account `null` and `undefined`. */
|
||||
"strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
|
||||
"strictBindCallApply": true, /* Check that the arguments for `bind`, `call`, and `apply` methods match the original function. */
|
||||
"strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
|
||||
"noImplicitThis": true, /* Enable error reporting when `this` is given the type `any`. */
|
||||
"useUnknownInCatchVariables": true, /* Type catch clause variables as 'unknown' instead of 'any'. */
|
||||
"alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
|
||||
"noUnusedLocals": true, /* Enable error reporting when a local variables aren't read. */
|
||||
"noUnusedParameters": true, /* Raise an error when a function parameter isn't read */
|
||||
"exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
|
||||
"noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
|
||||
"noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
|
||||
"noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */
|
||||
"noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
|
||||
"noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type */
|
||||
"noImplicitAny": true /* Enable error reporting for expressions and declarations with an implied `any` type.. */,
|
||||
"strictNullChecks": true /* When type checking, take into account `null` and `undefined`. */,
|
||||
"strictFunctionTypes": true /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */,
|
||||
"strictBindCallApply": true /* Check that the arguments for `bind`, `call`, and `apply` methods match the original function. */,
|
||||
"strictPropertyInitialization": true /* Check for class properties that are declared but not set in the constructor. */,
|
||||
"noImplicitThis": true /* Enable error reporting when `this` is given the type `any`. */,
|
||||
"useUnknownInCatchVariables": true /* Type catch clause variables as 'unknown' instead of 'any'. */,
|
||||
"alwaysStrict": true /* Ensure 'use strict' is always emitted. */,
|
||||
"noUnusedLocals": true /* Enable error reporting when a local variables aren't read. */,
|
||||
"noUnusedParameters": true /* Raise an error when a function parameter isn't read */,
|
||||
"exactOptionalPropertyTypes": true /* Interpret optional property types as written, rather than adding 'undefined'. */,
|
||||
"noImplicitReturns": true /* Enable error reporting for codepaths that do not explicitly return in a function. */,
|
||||
"noFallthroughCasesInSwitch": true /* Enable error reporting for fallthrough cases in switch statements. */,
|
||||
"noUncheckedIndexedAccess": true /* Include 'undefined' in index signature results */,
|
||||
"noImplicitOverride": true /* Ensure overriding members in derived classes are marked with an override modifier. */,
|
||||
"noPropertyAccessFromIndexSignature": true /* Enforces using indexed accessors for keys declared using an indexed type */,
|
||||
// "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
|
||||
// "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -47,9 +47,11 @@ DATA_INGESTOR_HOSTNAME=data-ingestor:3200
|
||||
ACCOUNTS_HOSTNAME=accounts:3003
|
||||
HOME_HOSTNAME=home:1444
|
||||
WORKER_HOSTNAME=worker:3452
|
||||
API_DOCS_HOSTNAME=api-docs:1445
|
||||
|
||||
# Routes. Usually does not need to change.
|
||||
REALTIME_ROUTE=/realtime
|
||||
API_DOCS_ROUTE=/docs
|
||||
MAIL_ROUTE=/mail
|
||||
DASHBOARD_ROUTE=/dashboard
|
||||
DASHBOARD_API_ROUTE=/api
|
||||
@@ -67,6 +69,7 @@ STATUS_PAGE_ROUTE=/status-page
|
||||
|
||||
#Ports. Usually they dont need to change.
|
||||
DASHBOARD_API_PORT=3002
|
||||
API_DOCS_PORT=1445
|
||||
WORKFLOW_PORT=3099
|
||||
ALERT_PORT=3088
|
||||
FILE_PORT=3125
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
"logs": "sudo docker compose logs --tail=100 -f $npm_config_services",
|
||||
"write-logs": "sudo docker compose logs -f $npm_config_services > logs.txt",
|
||||
"build": "npm run prerun && sudo docker compose build $npm_config_services",
|
||||
"force-build": "bash remove-node-modules.sh && npm run prerun && sudo docker compose build --no-cache $npm_config_services && bash install-node-modules.sh",
|
||||
"force-build": "npm run prerun && sudo docker compose build --no-cache $npm_config_services",
|
||||
"force-build-dev": "npm run config-to-dev && npm run force-build",
|
||||
"kill": "npm run stop",
|
||||
"prod": "npm run prerun && docker compose up -d",
|
||||
|
||||
Reference in New Issue
Block a user