Closed elguitarraverde closed 10 months ago
To keep API keys on the server-side and thus avoid exposing them in client-side code, I have made the following modifications:
I have transformed the script.js to module type and defined windows.getWeather() so that it can be called from onclick.
script.js
windows.getWeather()
I created a config.js file where the environment constants are exported.
config.js
In the script.js file I have imported the environment constants from the config.js file.
I changed the token string to the OPENWEATHERMAP_TOKEN constant.
OPENWEATHERMAP_TOKEN
Issue -> #36
To keep API keys on the server-side and thus avoid exposing them in client-side code, I have made the following modifications:
I have transformed the
script.js
to module type and definedwindows.getWeather()
so that it can be called from onclick.I created a
config.js
file where the environment constants are exported.In the
script.js
file I have imported the environment constants from theconfig.js
file.I changed the token string to the
OPENWEATHERMAP_TOKEN
constant.Issue -> #36
hacktoberfest