The recipes.blue monorepo recipes.blue
recipes appview atproto

fix: reintroduce static assets

Changed files
+24 -1
apps
api
src
web
src
routes
_.(app)
recipes
+20
apps/api/src/index.ts
··· 8 8 import * as Sentry from "@sentry/node" 9 9 import { recipeApp } from "./recipes/index.js"; 10 10 import { XRPCError } from "./util/xrpc.js"; 11 + import { getFilePathWithoutDefaultDocument } from "hono/utils/filepath"; 12 + import { readFileSync } from "fs"; 11 13 12 14 if (env.SENTRY_DSN) { 13 15 Sentry.init({ ··· 56 58 message: 'The server could not process the request.', 57 59 }); 58 60 } 61 + }); 62 + 63 + app.use('/*', async (ctx, next) => { 64 + if (ctx.finalized) return next(); 65 + 66 + let path = getFilePathWithoutDefaultDocument({ 67 + filename: 'index.html', 68 + root: env.PUBLIC_DIR, 69 + }) 70 + 71 + if (path) { 72 + path = `./${path}`; 73 + } else { 74 + return next(); 75 + } 76 + 77 + const index = readFileSync(path).toString(); 78 + return ctx.html(index); 59 79 }); 60 80 61 81 serve({
+4 -1
apps/web/src/routes/_.(app)/recipes/new.tsx
··· 56 56 component: RouteComponent, 57 57 }); 58 58 59 - const schema = RecipeRecord; 59 + const schema = RecipeRecord.extend({ 60 + time: z.coerce.number(), 61 + }); 60 62 61 63 function RouteComponent() { 62 64 const form = useForm<z.infer<typeof schema>>({ 63 65 resolver: zodResolver(schema), 64 66 defaultValues: { 65 67 title: "", 68 + time: 0, 66 69 description: "", 67 70 ingredients: [{ name: "" }], 68 71 steps: [{ text: "" }],