Skip to content

Programmatic API: configFile option is not honored #115

@kenrick95

Description

@kenrick95

When using the programmatic API of this package, I followed the example and documentation from the wiki.

On that page, it listed the option configFile as a parameter to LocalWebServer.listen()

So, I expect this piece of codes to work as intended (options are read from configFile):

const LocalWebServer = require('local-web-server')
const localWebServer = new LocalWebServer()
const server = localWebServer.listen({
  configFile: './path-to-file/lws.config.js'
})

server.close() 

But unfortunately, the config file is never read. I checked the source code in lws package and indeed, the config is only used at lib/command/serve.js which I believe is only invoked in the CLI application use case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions