feat: mount / unmount

This commit is contained in:
Nicolas Meienberger
2025-09-23 18:22:54 +02:00
parent 833bcb590f
commit f67152146d
17 changed files with 464 additions and 25 deletions

View File

@@ -1,11 +1,12 @@
import * as fs from "node:fs/promises";
import { Scalar } from "@scalar/hono-api-reference";
import { Hono } from "hono";
import { logger } from "hono/logger";
import { logger as honoLogger } from "hono/logger";
import { openAPISpecs } from "hono-openapi";
import { runDbMigrations } from "./db/db";
import { driverController } from "./modules/driver/driver.controller";
import { volumeController } from "./modules/volumes/volume.controller";
import { logger } from "./utils/logger";
export const generalDescriptor = (app: Hono) =>
openAPISpecs(app, {
@@ -25,9 +26,9 @@ export const scalarDescriptor = Scalar({
url: "/api/v1/openapi.json",
});
const driver = new Hono().use(logger()).route("/", driverController);
const driver = new Hono().use(honoLogger()).route("/", driverController);
const app = new Hono()
.use(logger())
.use(honoLogger())
.get("healthcheck", (c) => c.json({ status: "ok" }))
.basePath("/api/v1")
.route("/volumes", volumeController);
@@ -56,7 +57,7 @@ const socketPath = "/run/docker/plugins/ironmount.sock";
fetch: app.fetch,
});
console.log(`Server is running at http://localhost:8080 and unix socket at ${socketPath}`);
logger.info(`Server is running at http://localhost:8080 and unix socket at ${socketPath}`);
})();
export type AppType = typeof app;