Skip to content

Commit

Permalink
chore: remove basic auth from docs
Browse files Browse the repository at this point in the history
  • Loading branch information
rin-yato committed Oct 11, 2024
1 parent 8afc0a2 commit b72c82d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
16 changes: 9 additions & 7 deletions apps/api/src/lib/tasker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,18 @@ export function registerTasker(app: App, taskers: Tasker[]) {
// start all taskers
taskers.forEach((tasker) => tasker.start());

const serverAdapter = new HonoAdapter(serveStatic);
if (env.NODE_ENV !== "production") {
const serverAdapter = new HonoAdapter(serveStatic);

createBullBoard({
queues: taskers.map(createBullAdapter),
serverAdapter,
});
createBullBoard({
queues: taskers.map(createBullAdapter),
serverAdapter,
});

serverAdapter.setBasePath("/queue");
serverAdapter.setBasePath("/queue");

app.use("/queue", basicAuth(BASIC_AUTH)).route("/queue", serverAdapter.registerPlugin());
app.use("/queue", basicAuth(BASIC_AUTH)).route("/queue", serverAdapter.registerPlugin());
}
}

function createBullAdapter(tasker: Tasker) {
Expand Down
5 changes: 0 additions & 5 deletions apps/api/src/setup/openapi.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
import { apiReference } from "@scalar/hono-api-reference";
import type { App } from "./context";
import { env } from "@/lib/env";
import { basicAuth } from "hono/basic-auth";
import { BASIC_AUTH } from "@/constant/basic-auth";

export function registerOpenAPI(app: App) {
app.use("/docs/*", basicAuth(BASIC_AUTH));
app.use("/openapi", basicAuth(BASIC_AUTH));

app.doc31("/openapi", {
openapi: "3.1.0",
info: {
Expand Down

0 comments on commit b72c82d

Please sign in to comment.