A simple example of how to valdate forms using HTMX and Zod. It uses Express with TypeScript as the backend and JSX as the templating engine. There's also a corresponding blog post explaining how this works: Form validation with HTMX and Zod.
- Node v18 (LTS) or above
- PNPM
- Clone this repo
- Run
pnpm i
- Use any one of the below commands
pnpm dev
- Runs the development server with ESBuild (building TypeScript), Tailwind (building CSS), and Nodemon (watching for changes)pnpm build
- Builds the server for production using ESBuildpnpm start
- Start the built app