Skip to content
Advertisement

Tag: api-key

Can’t access API-key from .env-file

We are having problem accessing the API-key from our .env file when trying to fetch in our server.js. If we add the API-key manually to the URL in server.js it works, so the problem seems to be the connection between server.js and .env-file. We have npm installed dotenv. In the .env file we have written the key like this: WEATHER_API_KEY

Advertisement