import { Injectable } from '@nestjs/common';
import { readFileSync } from 'fs';
import { handlebars } from 'hbs';

@Injectable()
export class TemplateService {
    render(path: string, payload: any): string {
        const file = readFileSync(path).toString()
        const template = handlebars.compile(file);
        return template(payload)
    }
}
