@blubox/assets
v1.0.0
Published
Serve static files with blubox
Downloads
6
Maintainers
Readme
@blubox/assets
Serve static files with Blubox
Installation
npm i @blubox/assets
Quick start
Install dependencies
npm install blubox @blubox/assets
Create a Blubox application
const { Controller, Router, App } = require('blubox')
const controller = new Controller()
const app = new App(new Router({}))
app.listen(3000)
Use assets controller
const assets = require('@blubox/assets')
const path = require('path')
const app = new App(
new Router({
assets: assets({ dir: path.join(__dirname, '../public'), replace: 'assets' }),
})
)
Assets Options
/**
* assets(options, controller)
*
* @param {Object} [options]
* - {String} dir `Absolute location of file directory`
* - {String} raplace `Patname of the path where the files controller is located`
* @return {Function} assets controller
*
*/