fastify-twig

1.0.2 • Public • Published

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

Package Sidebar

Install

npm i fastify-twig

Weekly Downloads

0

Version

1.0.2

License

MIT

Unpacked Size

3.4 kB

Total Files

4

Last publish

Collaborators

  • ciro.spaciari