nextjs-koa-middleware
NextJS koa middleware
System Requirements
- NodeJS (version >= 12).
Installation
# npm npm i nextjs-koa-middleware# yarn yarn add nextjs-koa-middleware
Peer Dependency
- koa-router (version <= 8.0.8)
Usage
- Define environment variables:
NODE_ENV=development # Relative path to .next directory NEXT_CLIENT_DIR=/NEXT_CONFIG_PATH=/next.config.js
- Define NextJS Routes:
;; ; nextRouter.usedefaultReturn;nextRouter.get'/PagePath', render'pageComponentName';nextRouter.all'*', handleRoutes; ;
- Start koa server:
;; ;
License
Copylefted (c) 2020 Henrique Carvalho da Cruz Licensed under the MIT license.