dont allow examples when api is none (#243)

This commit is contained in:
Aman Varshney
2025-05-10 22:28:05 +05:30
committed by GitHub
parent 2924b817a3
commit 6a339bca1f
12 changed files with 188 additions and 241 deletions

View File

@@ -3,12 +3,14 @@ import "dotenv/config";
import { RPCHandler } from "@orpc/server/fetch";
import { createContext } from "./lib/context";
import { appRouter } from "./routers/index";
{{#if auth}}
import { auth } from "./lib/auth";
{{/if}}
{{/if}}
{{#if (eq api "trpc")}}
import { trpcServer } from "@hono/trpc-server";
import { createContext } from "./lib/context";
import { appRouter } from "./routers/index";
{{/if}}
{{#if auth}}
import { auth } from "./lib/auth";
{{/if}}
import { Hono } from "hono";
import { cors } from "hono/cors";
@@ -18,13 +20,6 @@ import { streamText } from "ai";
import { google } from "@ai-sdk/google";
import { stream } from "hono/streaming";
{{/if}}
{{#if (eq api "trpc")}}
import { createContext } from "./lib/context";
import { appRouter } from "./routers/index";
{{#if auth}}
import { auth } from "./lib/auth";
{{/if}}
{{/if}}
const app = new Hono();

View File

@@ -21,9 +21,7 @@ export const appRouter = {
{{/if}}
};
export type AppRouter = typeof appRouter;
{{/if}}
{{#if (eq api "trpc")}}
{{else if (eq api "trpc")}}
import {
{{#if auth}}protectedProcedure, {{/if}}publicProcedure,
router,
@@ -49,4 +47,7 @@ export const appRouter = router({
{{/if}}
});
export type AppRouter = typeof appRouter;
{{else}}
export const appRouter = {};
export type AppRouter = typeof appRouter;
{{/if}}