+
Welcome Home!
+
Go to Dashboard
+
healthCheck: {healthCheck.data}
+
+
+ );
+}
diff --git a/apps/cli/template/with-auth/packages/server/src/index.ts b/apps/cli/template/with-auth/packages/server/src/index.ts
new file mode 100644
index 0000000..c0715ae
--- /dev/null
+++ b/apps/cli/template/with-auth/packages/server/src/index.ts
@@ -0,0 +1,47 @@
+import { serve } from "@hono/node-server";
+import { trpcServer } from "@hono/trpc-server";
+import "dotenv/config";
+import { Hono } from "hono";
+import { cors } from "hono/cors";
+import { logger } from "hono/logger";
+import { auth } from "./lib/auth";
+import { createContext } from "./lib/context";
+import { appRouter } from "./routers/index";
+
+const app = new Hono();
+
+app.use(logger());
+
+app.use(
+ "/*",
+ 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, hono) => {
+ return createContext({ hono });
+ },
+ }),
+);
+
+app.get("/healthCheck", (c) => {
+ return c.text("OK");
+});
+
+const port = 3000;
+console.log(`Server is running on http://localhost:${port}`);
+
+serve({
+ fetch: app.fetch,
+ port,
+});
diff --git a/apps/cli/template/with-auth/packages/server/src/lib/trpc.ts b/apps/cli/template/with-auth/packages/server/src/lib/trpc.ts
new file mode 100644
index 0000000..3affce2
--- /dev/null
+++ b/apps/cli/template/with-auth/packages/server/src/lib/trpc.ts
@@ -0,0 +1,24 @@
+import { initTRPC, TRPCError } from "@trpc/server";
+import type { Context } from "./context";
+
+export const t = initTRPC.context