mirror of
https://github.com/FranP-code/create-better-t-stack.git
synced 2025-10-12 23:52:15 +00:00
dont allow examples when api is none (#243)
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
@@ -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}}
|
||||
|
||||
@@ -27,7 +27,7 @@ const healthCheck = useQuery($orpc.healthCheck.queryOptions())
|
||||
|
||||
<template>
|
||||
<div class="container mx-auto max-w-3xl px-4 py-2">
|
||||
<pre class="overflow-x-auto font-mono text-sm whitespace-pre-wrap">{{ TITLE_TEXT }}</pre>
|
||||
<pre class="overflow-x-auto font-mono text-sm whitespace-pre-wrap">\{{ TITLE_TEXT }}</pre>
|
||||
<div class="grid gap-6 mt-4">
|
||||
{{#unless (eq api "none")}}
|
||||
<section class="rounded-lg border p-4">
|
||||
@@ -50,10 +50,10 @@ const healthCheck = useQuery($orpc.healthCheck.queryOptions())
|
||||
Checking...
|
||||
</template>
|
||||
<template v-else-if="healthCheck.status.value === 'success'">
|
||||
Connected ({{ healthCheck.data.value }})
|
||||
Connected (\{{ healthCheck.data.value }})
|
||||
</template>
|
||||
<template v-else-if="healthCheck.status.value === 'error'">
|
||||
Error: {{ healthCheck.error.value?.message || 'Failed to connect' }}
|
||||
Error: \{{ healthCheck.error.value?.message || 'Failed to connect' }}
|
||||
</template>
|
||||
<template v-else>
|
||||
Idle
|
||||
|
||||
Reference in New Issue
Block a user