/felid-serve

A Felid.js plugin for sending static files.

Primary LanguageJavaScriptMIT LicenseMIT

felid-serve

npm version Node.js CI JavaScript Style Guide codecov

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