<p align="center">😎 @nexst/core 😎</p>
<p align="center">
  <a href="https://npm.im/@nexst/core" alt="A version of @nexst/core">
    <img src="https://img.shields.io/npm/v/@nexst/core.svg">
  </a>
  <a href="https://npm.im/@nexst/core" alt="Downloads of @nexst/core">
    <img src="https://img.shields.io/npm/dt/@nexst/core.svg">
  </a>
</p>

## NexstAppModule & NextModule

In the `server/app.module.ts`:

```ts
import {
  Module,
  MiddlewareConsumer,
} from '@nestjs/common';
import {
  NexstAppModule,
  NextModule,
} from '@nexst/core';
import { AppController } from './app.controller';

@Module({
  imports: [
    NextModule,
  ],
  controllers: [
    AppController,
  ],
})
export class AppModule extends NexstAppModule {
  configure(consumer: MiddlewareConsumer) {
    super.configure(consumer);

    // additional configurations here
  }
}
```

Then, use `render()` function where you want to SSR:

```ts
import {
  Controller,
  Get,
  Req,
  Res,
} from '@nestjs/common';
import {
  Request,
  Response,
} from 'express';
import { NextService } from '@nexst/core';

@Controller('auth')
export class AuthController {
  constructor(private readonly nextService: NextService) {}

  @Get('register')
  public async showRegisterPage(@Req() req: Request, @Res() res: Response) {
    return await this.nextService.render(req, res, 'auth/register');
  }
}
```

This will render `pages/auth/register.tsx`!
