HNHacker News
TopNewBestAskShowJobs

blomqma

6 karma · joined January 24, 2020

Open source author @blomqma/next-rest-framework
submissionscomments
blomqma··on [dead]
Next REST Framework is a framework for building type-safe, self-documenting REST APIs with Next.js. This post is about bringing visibility to an open-source tool that provides Next.js developers with an alternative approach to building REST APIs with type-safety and public documentation in mind. Think it as a RESTful alternative to trpc.io.

During the last two months, after the initial release I've been working on some of the following improvements after getting the first test users and resolving the first issues:

- Support for typed query parameters. - Support for projects using src folder. - Custom Swagger UI layout. - Major stability improvements to the public API (better compatibility with other Next.js API routes). - Developer documentation improvements, etc.

blomqma··on Cal.com: Open Scheduling Infrastructure
Tried signing up using Google OAuth, not allowing any scopes and got the following error: ``` {"message":"\nInvalid `prisma.user.findUnique()` invocation:\n\n\nError querying the database: db error: FATAL: remaining connection slots are reserved for non-replication superuser connections"} ```

A bit too much info maybe.

blomqma··on Validating Next.js API routes with object schemas
Yes, having a decorator-free approach was one of the main reasons why I started working on this - I've currently implemented the OpenAPI instrumentation in a way that all of your endpoints are called with specific headers that make those endpoints return their own API spec, generated from the parameters that they are defined with. While this might sound a bit IO-heavy with a potentially high amount of network requests, it is done only when calling the Swagger UI endpoint and it can be improved with some caching, I think.
blomqma··on Validating Next.js API routes with object schemas
I created an example on how one can easily add both compile-time and runtime validation with object schemas for their Next.js API routes using Next REST Framework, which is a framework for creating type-safe, self-documenting REST APIs for Next.js authored by yours truly.
blomqma··on Monitoring Dynamic API Routes
We rolled out a feature in Apilytics that allows easy monitoring of dynamic API routes by combining a set of fixes API routes into dynamic routes based on a user-defined pattern.