lwsjs / local-web-server

A lean, modular web server for rapid full-stack development.
MIT License
1.22k stars 86 forks source link

How to enable verbose option while using API of lws? #161

Closed aniket7824 closed 3 years ago

aniket7824 commented 3 years ago

While using the CLI variant, all the verbose is appearing in the console including verbose related to URL rewrite. How to get the same functionality in the case of an API variant of lws?

75lb commented 3 years ago

Listen for verbose event on the localWebServer instance..

Quickly, from the top of my head - something like this:

import LocalWebServer from 'local-web-server'

const options = { /* your options, port, directory etc */ }
const lws = LocalWebServer.create(options)

lws.on('verbose', (key, value) => {
  // process verbose info
}
aniket7824 commented 3 years ago

Thanks @75lb. That works!