Better HN
topnewbestaskshowjobs
Log inSign up

blomqma

6 karma · joined Jan 24, 2020 (6y ago) · 21 submissions

Open source author @blomqma/next-rest-framework
Submissions

comment 3y ago · link · parent

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 3y ago · link · parent

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 3y ago · link · parent

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 3y ago · link · parent

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.

5.

Validating Next.js API routes with object schemas(next-rest-framework.vercel.app ↗)

2 points · by blomqma · 3y ago · 3 comments

comment 4y ago · link · parent

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.

7.

Monitoring Dynamic API Routes(apilytics.io ↗)

2 points · by blomqma · 4y ago · 1 comment

8.

Apilytics API(apilytics.io ↗)

1 points · by blomqma · 4y ago · discuss

9.

The Problem with API Monitoring(apilytics.io ↗)

1 points · by blomqma · 4y ago · discuss