Dev Server
The velox dev command starts a development server with HMR.
Basic Usage
Section titled “Basic Usage”velox devServer starts at http://localhost:3030.
Options
Section titled “Options”velox dev --port 4000 # Custom portvelox dev --no-hmr # Disable HMR (use tsx watch)velox dev --verbose # Detailed outputHot Module Replacement
Section titled “Hot Module Replacement”HMR provides fast reloads when files change:
- Sub-second restart times
- Preserves server state
- Automatic
velox:readysignal for accurate timing
Configure HMR Boundaries
Section titled “Configure HMR Boundaries”In package.json:
{ "hotHook": { "boundaries": [ "src/procedures/**/*.ts", "src/schemas/**/*.ts" ] }}Server Ready Signal
Section titled “Server Ready Signal”For accurate timing metrics, add to your entry point:
await app.start({ port: 3030 });
if (process.send) { process.send({ type: 'velox:ready' });}Graceful Shutdown
Section titled “Graceful Shutdown”Add shutdown handlers to prevent connection leaks:
const shutdown = async () => { await prisma.$disconnect(); process.exit(0);};
process.on('SIGTERM', shutdown);process.on('SIGINT', shutdown);Next Steps
Section titled “Next Steps”- Generators - Code scaffolding
- Configuration - Server config