Skip to content

dwekat/nest-edge

Repository files navigation

Nest-Edge

Buy Me A Coffee

Edge templating engine implementation for Nest.Js

How to use

Install the package

npm i nest-edge

Use inside main.tsof your Nest application.

// main.ts

import { NestFactory } from '@nestjs/core';
import { NestExpressApplication } from '@nestjs/platform-express';
import { nestEdge } from 'nest-edge';
import { AppModule } from './app.module';
import { join } from 'path';

async function bootstrap() {
  const app = await NestFactory.create<NestExpressApplication>(AppModule);

  const engine = nestEdge({
    viewsRoot: join(__dirname, '..', 'views'),
    options: {
      cache: process.env.NODE_ENV === 'production',
    },
  });

  app.engine('edge', engine);
  app.setViewEngine('edge');
  await app.listen(3000);
}

bootstrap();

About

Edge.js templates for NestJs.

Resources

Stars

Watchers

Forks

Packages

No packages published