1.0.2 • Published 4 years ago

fastify-twig v1.0.2

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

npm package

fastify-twig

Twig view renderer for fastify

Support me for future versions:

BMC

PAGSEGURO

Quick Start

Configuration and Usage example

    const path = require('path');

    const fastify = require('fastify')();

    fastify.register(require('fastify-twig'), {
        views: path.resolve('./views')
    });

    fastify.get('/', async (request, reply) => {

        const model = {
            message: 'Hello World'
        };

        reply.view('./home/index', model);
    });