refactor: update API documentation routes and paths to v1 naming convention

This commit is contained in:
ramvignesh-b
2026-05-12 05:01:58 +05:30
parent cf37904083
commit 5d8a9ccb3e
2 changed files with 6 additions and 5 deletions
+5 -4
View File
@@ -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());
+1 -1
View File
@@ -64,7 +64,7 @@ export const Dashboard = (props: { isUnlocked: boolean }) => (
<nav class="hidden md:flex items-center gap-1">
<a
href="/docs"
href="/docs/v1"
target="_blank"
class="btn btn-ghost btn-sm text-base-content/60 hover:text-primary gap-2 px-3"
rel="noopener"