For context, I am using the reactjs gatsby framework which provides a plugin to connect to a strapi backend. When specifying the strapi api url as "localhost", it throws an error "econnrefused". Yet, when using "127.0.0.1", the error is resolved. I know localhost and 127.0.0.1 are not exactly the same, but I'd like to know some possible reasons why this might be occurring (full disclosure: beginner level here).
p.s. documentation says to use "localhost" which is throwing the error for me.
Thanks so much!
Summary: following the gatsby-source-strapi plugin instructions, I specified "localhost" as the strapi api url (localhost:1337). When starting up the local development server (localhost:8000), the "econnrefused" error would be thrown by the plugin. However, when "127.0.0.1" (which localhost is an alias for) was used, the error would be resolved.