Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Discussion] Make the Server an external actor #40

Open
pragmaticivan opened this issue Feb 24, 2017 · 1 comment
Open

[Discussion] Make the Server an external actor #40

pragmaticivan opened this issue Feb 24, 2017 · 1 comment

Comments

@pragmaticivan
Copy link
Contributor

pragmaticivan commented Feb 24, 2017

Currently, we expose Server and ServerFactory on the project index.js (https://github.com/wedeploy/magnet/blob/master/src/index.js)

If the user decides to use a programmatically way by not using the CLI, it should allow the user to be able to set a server for the Magnet class.

  • It should allow the user to create its own server configuration or even use another engine instead of Express.
const magnet = new Magnet({config, directory});

We currently don't accept a server on the constructor, maybe we can turn that into optional param:

const magnet = new Magnet({config, directory, server});

If a server is not provided, Magnet creates a server with express by default.

ps.: It could be solved by having a Get + Set for a Server, the set would be performed twice, so I would prefer having that into the constructor.

@eduardolundgren
Copy link
Contributor

eduardolundgren commented Feb 24, 2017

In order to achieve that we need to first make sure we don't rely on express proprietary apis, such as res.type() and so on, it's doable to rely only on Node interfaces to operate on response object. After that change we can expose the server as suggested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants