1

I am trying add a config.json file to the public folder, that can be used to change the IP of the backend system.

The config.json files looks like this

{
    "graphEndpoint" : "http://10.1.1.177:5000"
}

Currently I am importing it in the components that requires it as such

import graphConfig from '../../public/config.json'

However, the issue is after building the application to static files changing the configuration does not have any effect on the application.

I tried the first two solutions from -> Vue js with an external configuration file

However, it error out, possibly due my application being in TypeScript.

  • 1
    I would agree with the first [answer](https://stackoverflow.com/a/60114397/7176268). I would put the json file in your public directory of your vue app. With this you'll want to make sure your json is alongside your compiled js and not bundled together. If you plan on modifying this on the server I would actually put it in your servers public folder. This way your changes aren't overwritten on vue build. – LLai Apr 19 '21 at 04:00
  • @Atiqul What's the error you saw? – tony19 Apr 19 '21 at 06:11

0 Answers0