felid-serve

1.2.0 • Public • Published

felid-serve

npm version Build Status JavaScript Style Guide

A Felid plugin for sending static files.

Install

npm install felid-serve

or

yarn add felid-serve

Usage

const Felid = require('felid')
const serve = require('felid-serve')
 
const app = new Felid()
app.plugin(serve, options)
 
app.get('/', (req, res) => {
  res.serve('/static/index.html')
})

Options

  • decorator Object: Customize the decorator names. Default is:
{
  serve: 'serve'
}

For more options, please check send.

Some has default values:

  • root: default to the directory where node runs.

Api

  • response.serve(path: String, options: Object): Serve the given file. The options passed here will override the plugin options.

License

MIT

/felid-serve/

    Package Sidebar

    Install

    npm i felid-serve

    Weekly Downloads

    0

    Version

    1.2.0

    License

    MIT

    Unpacked Size

    5.7 kB

    Total Files

    6

    Last publish

    Collaborators

    • zoron