API Reference
svrx(option)
Get the instance of Svrx
Usage
const svrx = require('@svrx/svrx');
const server = svrx({
port: 8002
});Param
option: see option reference
Return
the instance of Svrx
server.start()
Start svrx
Usage
server.start().then(port => {
console.log(port);
});Return
Promise
server.close()
Usage
Param
Return
Promise
server.reload()
Manually refresh the browser
Usage
server.on
Attach event listener
builtin events
1. ready
readyEmit when svrx start
2. plugin
pluginEmit after plugin building, as same as hook.onCreate, see How to create plugin for more details
3. file:change
file:changeemit after file change (make sure that livereload is enable)
server.off
unbind specific event
server.emit
Last updated
Was this helpful?