0.0.21 • Published 1 year ago

endurance-js v0.0.21

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

Overview

Endurance.js is a Next.js API Resource library that allows you to create API resources for your Next.js application. It is built on top of Next.js API Routes and uses Prisma ORM to connect to your database.

Getting Started

Install Endurance JS

To get started, you can install Endurance.js using npm:

npm install endurance-js

Add API route

To add NextAuth.js to a project create a file called [[...path]].ts in pages/api. This contains the dynamic route handler for Endurance.js which will also contain all of your global Endurance.js configurations.

import serverHandler from "endurance-js/lib/router";
import { NextApiRequest, NextApiResponse } from "next";
import entities from "../../Entity";

export default function handler(req: NextApiRequest, res: NextApiResponse) {
    return serverHandler(req, res, {
        entities: entities,
    });
}

All requests to /api/* (users, posts, roles, etc.) will automatically be handled by Endurance.js.

0.0.21

1 year ago

0.0.17

1 year ago

0.0.16

1 year ago

0.0.15

1 year ago

0.0.14

1 year ago

0.0.13

1 year ago

0.0.12

1 year ago

0.0.11

1 year ago

0.0.10

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago