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

[Q] Integrate with vue-cli-service #8

Closed
lajosbencz opened this issue Feb 6, 2020 · 2 comments
Closed

[Q] Integrate with vue-cli-service #8

lajosbencz opened this issue Feb 6, 2020 · 2 comments
Labels

Comments

@lajosbencz
Copy link

How would one go about running your router along with a self-served Vue application?

The standard way to extend Vue's devServer:

// vue.config.js
module.exports = {
  devServer: {
    port: 3000,
    before(app, server, compiler) {
      // stuff...
    },
  },
};

If i create FoxRouter like so:

const FoxRouter = require('fox-wamp');
// ...
before(app, server) {
  const router = new FoxRouter();
  router.listenWAMP({server, path: '/ws/'});
}

the process dies, beause it cannot find the method on on the server instance.

If i create the router like so:

const FoxRouter = require('fox-wamp');
// ...
before(app, server) {
  const router = new FoxRouter();
  router.listenWAMP({server: app, path: '/ws/'});
}

then the default index page gets served if i navigate to /ws/.

Could You please advise?

@kalmyk
Copy link
Owner

kalmyk commented Feb 7, 2020

Hello Lajos!

Thank you for interest to the project!

I am not sure that I have clear understanding of the problem you described.
As I see "devServer" is part of WebPack build system. If I understand correctly
the module helps reload browser page automatically afterwards of backend code change.

I am not sure what is type of passed to before method variables but FoxWamp expects
httpServer type in server attribute. See Express web server integration example below

https://github.com/kalmyk/fox-wamp#template-to-share-http-port-with-express

@kalmyk
Copy link
Owner

kalmyk commented Mar 6, 2020

I am closing the issue if httpServer meets your expectations.

@kalmyk kalmyk closed this as completed Mar 6, 2020
@kalmyk kalmyk added the question label Mar 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants