mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-24 23:07:25 +08:00
using swagger spec
This commit is contained in:
parent
db46b5e380
commit
9b34728629
1 changed files with 2 additions and 0 deletions
|
|
@ -10,6 +10,7 @@ import { asyncHandler } from "../../middlewares/api-utils";
|
|||
import { MonkeyResponse } from "../../utils/monkey-response";
|
||||
import { Application, NextFunction, Response } from "express";
|
||||
import swStats from "swagger-stats";
|
||||
import SwaggerSpec from "../../swagger.json";
|
||||
|
||||
const pathOverride = process.env.API_PATH_OVERRIDE;
|
||||
const BASE_ROUTE = pathOverride ? `/${pathOverride}` : "";
|
||||
|
|
@ -37,6 +38,7 @@ function addApiRoutes(app: Application): void {
|
|||
uriPath: "/stats",
|
||||
authentication: process.env.MODE !== "dev",
|
||||
apdexThreshold: 100,
|
||||
swaggerSpec: SwaggerSpec,
|
||||
onAuthenticate: (_req, username, password) => {
|
||||
return (
|
||||
username === process.env.STATS_USERNAME &&
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue