nest-edge
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

Nest-Edge

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();

Package Sidebar

Install

npm i nest-edge

Weekly Downloads

20

Version

1.0.5

License

MIT

Unpacked Size

30 kB

Total Files

9

Last publish

Collaborators

  • dwekat