finds.dev← search

// the find

JKHeadley/rest-hapi

★ 1,182 · JavaScript · MIT · updated Mar 2023

🚀 A RESTful API generator for Node.js

rest-hapi generates CRUD REST endpoints from Mongoose schemas as a Hapi.js plugin. You define a model, it gives you GET/POST/PUT/DELETE plus association endpoints, Swagger docs, and query parameter support for free. Aimed at Node.js developers who want a working MongoDB-backed API without writing boilerplate.

Auto-generated association endpoints (one-to-many, many-to-many) with embedded linking models is genuinely useful and not something most generators bother with. Built-in audit log that tracks every mutation per-document is a real feature, not an afterthought. Joi validation is wired in at the schema level, so you get request validation without configuring it per-route. The query parameter system—filtering, sorting, pagination, embedding related docs—works out of the box and is well-documented.

Last commit was March 2023 and the project shows no signs of active maintenance; Hapi itself has had multiple major releases since then and the ecosystem has largely moved on. Hard coupling to MongoDB/Mongoose means you cannot use this with PostgreSQL or any relational database, which is an odd choice given the 'relational structure' marketing. The generated Swagger docs are a side effect of the generator, not something you can meaningfully customize without fighting the internals. No TypeScript support—models are plain JS objects, so you lose type safety the moment your schema gets non-trivial.

View on GitHub → Homepage ↗

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →