TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: Auto generate REST API from Mongoose schemas

17 点作者 aciswhat将近 5 年前

3 条评论

_bxg1将近 5 年前
For a long time I&#x27;ve thought that the idea of having an entire, Turing-complete layer between the database and the HTTP API felt like overkill. You know your collections, you know the shape of your data, auth doesn&#x27;t vary much between orgs. Unless you&#x27;re doing interesting computations after querying, why do you have to <i>program</i> those endpoints over and over again for each entity in each project? It just seems silly.<p>I&#x27;m honestly surprised there aren&#x27;t more projects like this
评论 #23591543 未加载
评论 #23592672 未加载
aciswhat将近 5 年前
Hello Hacker News! This is something I quickly prototyped yesterday to automatically generate a REST API from existing Mongoose schemas. It&#x27;s incredibly useful for mocking your exact backend, or just spinning up an MVP backend.<p>Authentication is also built in (currently only supports email&#x2F;password, but more in the works). I implemented granular permissions for API routes that can be set via configuration really easily, which uses JWTs from the user login.
评论 #23591540 未加载
5986043handy将近 5 年前
This seems pretty useful! Will try out for my next side project.