You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
529 B

3 years ago
3 years ago
  1. const BASE_URL = function () {
  2. switch (process.env.FLYLOCAL_ENV) {
  3. case "prod":
  4. return process.env.PROD_URL;
  5. case "dev":
  6. return process.env.DEV_URL;
  7. case "local":
  8. return "http://" + process.env.LOCAL_IP + ":" + process.env.LOCAL_PORT;
  9. default:
  10. break;
  11. }
  12. }
  13. export default ({ app }, inject) => {
  14. // Inject $hello(msg) in Vue, context and store.
  15. inject('BASE_URL', () => BASE_URL())
  16. inject('hello', msg => console.log(`Hello ${msg}!`))
  17. }