0

I'm trying to set up API_URL variable to my dev.env.js file:

'use strict'
const merge = require('webpack-merge')
const prodEnv = require('./prod.env')

module.exports = merge(prodEnv, {
  NODE_ENV: '"development"',
  API_URL: '"http://127.0.0.1:8000/api"'
})

and use it for api calls:

this.$http.get('${process.env.API_URL}/companyAddress')

and somehow my server response me with error:

Response {url: "http://127.0.0.1:8000/api/$/companyAddress", 
ok: false, status: 405, statusText: "Method Not Allowed",

why is this happening? where does this "$" comes from?

gileneusz
  • 1,435
  • 8
  • 30
  • 51

1 Answers1

1

Problem is here:

this.$http.get('${process.env.API_URL}/companyAddress')

And the answer is here: ES6 / ECMA6 template literals - not working

gizyk
  • 131
  • 1
  • 1
  • 5