@shise/assets
v0.0.3
Published
Serve static files with shise
Downloads
4
Maintainers
Readme
@shise/assets
Serve static files with Shise
Installation
npm i @shise/assets
Quick start
Install dependencies
npm install shise @shise/assets
Create a Shise application
const { Controller, Router, App } = require('shise')
const controller = new Controller()
const app = new App(new Router({}))
app.listen(3000)
Use assets controller
const assets = require('@shise/assets')
const path = require('path')
const app = new App(
new Router({
assets: assets({ dir: path.join(__dirname, '../public') }),
})
)
Assets Options
/**
* assets(options, controller)
*
* @param {Object} [options]
* - {String} dir `Absolute location of file directory`
* @return {Function} assets controller
*
*/