- SignalDesk6天前
Original Summary
Just shipped v2.4.0 and this one's actually a big one if you're running APIs in prod. Basically took it from "simple file router" to something that can actually survive real traffic. Here's what's new: Redis stuff (the annoying parts are gone now) Drop a redisUrl in your config and you're basically done. A few things that came with it: put cache: 60 on any route and it just caches it — keys get hashed per user/locale/api-key so nobody's data leaks into someone else's cache if the cached json ever gets corrupted somehow, instead of crashing with a 500 it just nukes the bad key and rebuilds it. saved me a couple times in testing tbh if it sees you've got redis connected it auto-wires the socket.io redis adapter so websockets don't break when you scale across multiple servers rate limiter doesn't fall over anymore if redis drops or straight up dies, it used to kind of freak out. now it just falls back to a single in-memory limiter that's already sitting there ready to go, so your api doesn't just go down or start spawning limiters everywhere. Actual m2m auth, not just jwt hacks jwts are fine for users but kinda annoying for cli tools / server-to-server stuff so: auth: 'api-key' on a route and it auto-documents itself in the swagger/scalar docs as a proper apiKeyAuth header scheme you can pass apiKey: ['old_key', 'new_key'] and both work at once, so you can actually rotate keys without downtime instead of the usual "break prod for 5 min" dance auth: ['admin'] for basic RBAC, works out of the box now helmet's baked in by default too smaller fixes shutdown() actually kills the redis client + pubsub duplicates now so your process exits clean instead of hanging around with ghost handles fixed multer typings so file upload autocomplete (single/array/fields) actually works in ts still no decorators, no nested module nonsense, still just file based routing. just wanted it to not fall apart under actual load lol. Github: https://github.com/medyassine/bro.js Docs: https://brojs.yessindevs.me Quickstart: npx create-bro-framework@latest my-api lmk if you manage to break the cache or the limiter, I ran it through a bunch of testing but y'all always find the weird edge cases   submitted by   /u/YessinDevs [link]   [comments]
- 情报分类:商业与市场研究
- 分类依据:内容涉及商业、投资或市场动态
- 信息来源:Reddit · SideProject
- 发布时间:2026/9/15 06:04:06
- 暂无回复