React configurations

What is the best way to access appsettings.json file in react component?

Hi @Anu1! Can you describe your folder structure? Where is appsettings.json stored relative to your React component?

Hi there,

Below is the structure in visual studio solution explorer


mycomponent(This is where i want to access appsettings.json)

Thanks in advance.

I am having trouble understanding this - what are the files and folders. Can you post a screenshot of the solution explorer?

Also, when your main index page loads (I’m assuming using localhost), can you access appsettings.json via the address bar? In other words, does Visual Studio deploy this file as part of the bundle that gets served up to the web server?

Below is sceen shot of appsettings.json in relative to project and component from where i want to access appsettings falls under components folder.

I dont have access to appsettings.json in address bar.


Sorry for the delay, but you won’t be able to access this file unless you duplicate it (or edit the project settings) to move the file into your public folder.