1.2.0 • Published 4 years ago

felid-serve v1.2.0

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

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