Template
Ports nextjs-templates/shopify-storefront to Vite, TanStack Router/Query, Tailwind v4 and Hono, without the AI store assistant. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
18 lines
496 B
TypeScript
18 lines
496 B
TypeScript
// The API surface. In dev, @hono/vite-dev-server mounts this inside Vite; in
|
|
// production, server/node.ts serves it alongside the built client.
|
|
import { Hono } from 'hono';
|
|
import { account } from './account';
|
|
|
|
const app = new Hono().basePath('/api');
|
|
|
|
app.route('/account', account);
|
|
|
|
app.notFound((c) => c.json({ error: 'Not found' }, 404));
|
|
|
|
app.onError((err, c) => {
|
|
console.error(err);
|
|
return c.json({ error: 'Something went wrong. Please try again.' }, 500);
|
|
});
|
|
|
|
export default app;
|