1

I'm really new in VueJS, I use RxJS, Vue rx and Vue Resource in a mixin so i can make http calls and get observables back anywhere... awesome! now i tried

 subscriptions () {
  return {
    titles$: this.getHTTPObservable('https://jsonplaceholder.typicode.com/albums').flatMap(arr => Rx.Observable.from(arr).take(10).map(o => o.title).toArray())
  }

The only thing i need now is to specify the end point of the server i am requesting in some configuration file like i would do in angular environments file. When launching the build by hand it should look like when i write

ng serve --env=dev

is there something similar?

2 Answers 2

1

Actually i found the answer on this page https://vuejs-templates.github.io/webpack/env.html

so, i can add any configuration variable and then call process.env.varname to get it back, thanks

Sign up to request clarification or add additional context in comments.

Comments

0

Vue.js normally works in conjunction with Webpack to achieve this.

https://v2.vuejs.org/v2/guide/deployment.html#With-Build-Tools

The DefinePlugin from Webpack is used for this. Outside of Webpack I think you are still able to use this:

https://www.npmjs.com/package/cross-env

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.