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.

2
  • 1
    I would agree with the first answer. 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. Commented Apr 19, 2021 at 4:00
  • @Atiqul What's the error you saw? Commented Apr 19, 2021 at 6:11

0

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.