Since we are only running these tests locally for now, we can simply hardcode the host name of our local API server, which we've set to http://localhost:8080/. However, it's never ideal to hardcode values into our code, as when we want to run these same tests on a different server, we'd have to edit the code itself.
Instead, we can make use of environment variables, which we can set in an .env file at the project root directory and load it when we run our tests.
Create a new .env file and add in the following entry:
SERVER_PROTOCOL=httpSERVER_HOSTNAME=localhostSERVER_PORT=8080
Next, we need to load the environment variable into our code. We can use the dotenv-cli package (https://www.npmjs.com/package/dotenv-cli ...