mirror of
https://github.com/FranP-code/Reflecto.git
synced 2025-10-13 00:43:31 +00:00
Biome format
This commit is contained in:
@@ -14,43 +14,42 @@ import { logger } from "./lib/logger";
|
||||
const app = new Hono();
|
||||
|
||||
if (process.env.NODE_ENV === "development") {
|
||||
try {
|
||||
const composePath = join(process.cwd(), "docker-compose.yml");
|
||||
execSync(`docker-compose -f ${composePath} up -d`, { stdio: "inherit" });
|
||||
logger.info("Waiting for services to start...");
|
||||
execSync("sleep 2");
|
||||
logger.info("Docker Compose started successfully");
|
||||
} catch (error) {
|
||||
logger.error("Failed to start Docker Compose:", error);
|
||||
}
|
||||
|
||||
try {
|
||||
const composePath = join(process.cwd(), "docker-compose.yml");
|
||||
execSync(`docker-compose -f ${composePath} up -d`, { stdio: "inherit" });
|
||||
logger.info("Waiting for services to start...");
|
||||
execSync("sleep 2");
|
||||
logger.info("Docker Compose started successfully");
|
||||
} catch (error) {
|
||||
logger.error("Failed to start Docker Compose:", error);
|
||||
}
|
||||
}
|
||||
|
||||
app.use(honoLogger());
|
||||
app.use(
|
||||
"/*",
|
||||
cors({
|
||||
origin: process.env.CORS_ORIGIN || "",
|
||||
allowMethods: ["GET", "POST", "OPTIONS"],
|
||||
allowHeaders: ["Content-Type", "Authorization"],
|
||||
credentials: true,
|
||||
}),
|
||||
"/*",
|
||||
cors({
|
||||
origin: process.env.CORS_ORIGIN || "",
|
||||
allowMethods: ["GET", "POST", "OPTIONS"],
|
||||
allowHeaders: ["Content-Type", "Authorization"],
|
||||
credentials: true,
|
||||
})
|
||||
);
|
||||
|
||||
app.on(["POST", "GET"], "/api/auth/**", (c) => auth.handler(c.req.raw));
|
||||
|
||||
app.use(
|
||||
"/trpc/*",
|
||||
trpcServer({
|
||||
router: appRouter,
|
||||
createContext: (_opts, context) => {
|
||||
return createContext({ context });
|
||||
},
|
||||
}),
|
||||
"/trpc/*",
|
||||
trpcServer({
|
||||
router: appRouter,
|
||||
createContext: (_opts, context) => {
|
||||
return createContext({ context });
|
||||
},
|
||||
})
|
||||
);
|
||||
|
||||
app.get("/", (c) => {
|
||||
return c.text("OK");
|
||||
return c.text("OK");
|
||||
});
|
||||
|
||||
export default app;
|
||||
|
||||
Reference in New Issue
Block a user