Set up node to communicate with a Flask backend that someone else built for a volunteering project.

Reorganised code to place the frontend I built and the backend someone else built in the same repo, so I can use relative routes like “/login” instead of exposing the server address of what I’m working on like XX.XX.XX:XXXX/login.

Also had to figure out why env variables couldn’t be accessed by Flask, then I realised I needed to use the dotenv library to retrieve variables from an .env file.

I found the following articles useful: Easiest Way to Connect a React Frontend with Node.js

Connecting Flask with Node.js

Making Use of Environment Variables in Python

I didn’t work on my projects for a while as I made the mistake of going out to meet friends too many times in a week when I don’t really have the social batteries for it. Looking forward to pacing myself better in the future, and hibernating + hacking away at my own stuff for the next week!!