From 5d8a9ccb3e9a69e39079c792acbc160d7e75d98a Mon Sep 17 00:00:00 2001 From: ramvignesh-b Date: Tue, 12 May 2026 05:01:58 +0530 Subject: [PATCH] refactor: update API documentation routes and paths to v1 naming convention --- src/index.ts | 9 +++++---- src/routes/dashboard.tsx | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/index.ts b/src/index.ts index 4d88a1c..73667ec 100644 --- a/src/index.ts +++ b/src/index.ts @@ -13,7 +13,7 @@ import { dashboardRoutes } from "./routes/dashboard"; const app = new OpenAPIHono({ strict: false }); // OpenAPI specs -app.doc("/doc", { +app.doc("/docs/v1/openapi.json", { openapi: "3.0.0", info: { version: "1.0.0", @@ -38,13 +38,14 @@ app.openAPIRegistry.registerComponent("securitySchemes", "API_KEY", { // Scalar API Reference app.get( - "/api", + "/docs/v1", Scalar({ theme: "solarized", - url: "/doc", + url: "/docs/v1/openapi.json", }), ); -app.get("/docs", (c) => c.redirect("/api")); +app.get("/docs", (c) => c.redirect("/docs/v1")); +app.get("/api", (c) => c.redirect("/docs/v1")); app.use("*", logger()); app.use("*", prettyJSON()); diff --git a/src/routes/dashboard.tsx b/src/routes/dashboard.tsx index 0976c95..0075e27 100644 --- a/src/routes/dashboard.tsx +++ b/src/routes/dashboard.tsx @@ -64,7 +64,7 @@ export const Dashboard = (props: { isUnlocked: boolean }) => (