@forrestjs/service-fastify-static

5.2.2 • Public • Published

@forrestjs/service-fastify-static

ForrestJS wrapper to the Fastify Static plugin.

Live Demo

https://codesandbox.io/s/service-fastify-static-6u8mm

Install & Setup

Install the dependency:

npm add @forrestjs/service-fastify-static

Add it to your App:

// index.js
const path = require('path');
const forrestjs = require('@forrestjs/core');
const serviceFastify = require('@forrestjs/service-fastify');
const serviceFastifyStatic = require('@forrestjs/service-fastify-static');

// Run the app:
forrestjs.run({
  services: [serviceFastify, serviceFastifyStatic],
  settings: {
    fastify: {
      static: {
        root: path.join(__dirname, 'public'),
      },
    },
  },
});

Options

setConfig('fastify.static', {
  ...options here
});

Package Sidebar

Install

npm i @forrestjs/service-fastify-static

Weekly Downloads

41

Version

5.2.2

License

MIT

Unpacked Size

3.21 kB

Total Files

4

Last publish

Collaborators

  • marcopeg