Nest Next Renderer
Module for rendering Next.js pages inside Next.js applications.
Note: At the moment this package works only with Next and Fastify.
Installation
This package requires to be installed in a Next application that is using Fastify as platform (read more).
Peer dependencies
This is the full list of peer dependencies:
Note: In theory you should install just react
, react-dom
and next
because @nestjs/common
and fastify
might be already installed.
Install
Run: yarn add nest-next-renderer
Usage
Import the module:
import { Module } from '@nestjs/common';
import { NextRendererModule } from 'nest-next-renderer';
@Module({
imports: [
NextRendererModule.forRoot({
dev: process.env.NODE_ENV !== 'production',
dir: './client',
customServer: true,
conf: {
},
}),
],
})
export class AppModule {}
Render from a controller: