blomqma

Joined 6 years ago

Karma
6
Submissions
21
Member since
Jan 24
Open source author @blomqma/next-rest-framework
View on Hacker News

Recent submissions

Comment · 3 years ago
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.

Comment · 3 years ago
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.

Comment · 3 years ago
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.
Comment · 3 years ago
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.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton