Click here to Skip to main content
15,881,938 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all, I have a file created a file (EnvironmentConfig.js) for Configuration Settings in the ClientApp folder of the React .Net Application with .Net core.
export const EnvironmentConfig = [{
    'ID': 'DepartmentApi',
    'Url': 'https://localhost:44396/api/department'
}, {
    'ID': 'EmployeeApi',
    'Url': 'https://localhost:44396/api/employee'
}
];

I want to read the Url value depending upon the Id value in the Component, as the file EnvironmentConfig.js is in the root folder of the react ie the ClientApp, components are in the component folder, I want to read Url value depending upon the Id I select. I have imported the EnvironmentConfig in my component and one more thing, if there is better and easier approach than this to store our api etc urls please let me know I would much appreciate that as well, but I am very new to the JavaScript World, hence if it is easy and secure then please suggest me - any help would be very helpful thanks in advance.

What I have tried:

Googling researching online asking colleagues
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900