0.4.4 • Published 2 years ago

next-ts-route v0.4.4

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

Next TS Route

next-ts-route provides high-level utilities for defining type-safe Next.js routes.

Usage

Create a ./utils/route.ts file with the following code:

// File: ./utils/route.ts
const { defineRoute, defineGetServerSideProps } = createRouteBuilder({
  beforeRouteHandler({ req, res }) {
    // Code to run before your per-route handler code (e.g. authentication code, adding properties to the `req` object)
  },
  beforeGetServerSideProps({ req, res }) {
    // Code to run before your `getServerSideProps` handler code
  }
})

Then, in your route files ()

0.4.4

2 years ago

0.4.1

2 years ago

0.4.0

2 years ago

0.4.3

2 years ago

0.4.2

2 years ago

0.3.1

2 years ago

0.3.0

2 years ago

0.2.2

2 years ago

0.2.1

2 years ago

0.1.4

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago