Elysia API with Next.js demo
A demo app with a Next.js frontend and a separate Elysia backend.
Important files:
- api/src/index.ts
The Elysia router, some sample routes that return sample data. - frontend/src/api.ts
The frontend api file that imports the Elysia types from the backend. - frontend/src/app/page.tsx
Fetches the essays on the frontend on the server side. - frontend/src/components/Footer.tsx
Fetches the CTA data on the frontend on the client side using React Query.
Local development
To get the demo running locally, first install Bun.
Then, run bun i in the frontend and api folders to install deps.
Finally run bun dev in both folders to start the api and frontend. Visit http://localhost:3001 in your browser.
On this page
Contributors
Created July 2, 2024
Updated July 2, 2024