Urgent.News

What's breaking now, across thousands of outlets.

Tech

Got tired of rewriting Express boilerplate, so I built a zero-config alternative

Juggling client contracts and building full-stack applications means spinning up new backends constantly. But manually wiring up Express routers, configuring JWT authentication, and setting up Zod validation for every single project was completely destroying my momentum. I wanted the seamless developer experience of Next.js, but for a standalone Node API. Since nothing quite fit the bill, I built…

Spinning up new backends constantly is a common challenge for developers handling client contracts and building full-stack applications. Manually wiring up Express routers, configuring JWT authentication, and setting up Zod validation for each project was significantly impeding developer momentum. The desire for a seamless developer experience akin to Next.js, but tailored for standalone Node APIs led to the creation of bro.js.

This zero-config alternative serves as an engine wrapper around Express, eliminating the need for boilerplate code and allowing developers to focus solely on their logic.

File-Based Routing is a key feature of bro.js. By simply dropping a file named [id].get.js into the routes folder, an endpoint is instantly accessible. Built-in Zod Validation simplifies the process further by allowing developers to pass a schema to the route definition. The framework automatically rejects bad requests with a 400 error, ensuring robust input validation.

Native WebSockets are pre-configured and seamlessly integrated into the route context via ctx.io, enabling real-time communication. Auto-Generated SDKs are another notable feature. Running the command 'bro sdk' compiles a typed client SDK that is perfectly formatted for the frontend, streamlining the development process.

Booting a new environment is straightforward. With the command 'npx create-bro-framework@latest my-api', developers can swiftly initiate a new project. The author invites the community to try out this innovative approach and provide feedback. Documentation is available on the project website, and the GitHub repository is open to stars and contributions.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

The incomplete history of Duo devices

Apple announced the company's first device with a folding screen today, the iPhone Duo, but that's where the firsts end. The Duo is not only far from the first foldable on the market thanks to the…

More from Wednesday 9 September →