Quality API logo

Quick start

To install and setup Quality API, simply run the following command in your command line:

Select your package manager and display its command variant
npm install @quality-api/core

Your first endpoint

Quality API follows the builder pattern. This makes adding middleware easy, and makes the code easier to structure.
A simple endpoint, with a middleware, would look something like this:

import QualityApi from "@quality-api/core";
import authenticate from "@/middleware/authenticate";

export const GET =
    QualityApi.start()
        .add(authenticate)
        .end(request => {
            return Response.json({ message: "The quick brown fox" });
        });

The middleware is, naturally, added in chronological order, meaning added first means executed first.