toa-favicon
Favicon middleware for toa.
toa
Demo
use as middleware:
const Toa = const favicon = const app = app appapp
use as module:
const Toa = const favicon = 'examples' const app = app app
Installation
npm install toa-favicon
API
const favicon = ;
favicon([options])
Return a thunk function.
options.path
(String) - The directory you wish to serve, default toprocess.cwd()
.options.maxAge
(Number) - Cache control max age (ms) for the files, default to10 * 24 * 60 * 60 * 1000
.
favicon('static')
is equal to favicon({path: 'static'})
.
favicon('static')
is equal to favicon('static/favicon.ico')
.
favicon('static')
is equal to favicon('process.cwd()/static/favicon.ico')
.
License
The MIT License (MIT)