Closed Tim-Quattrochi closed 5 months ago
I managed to get rid of the bug and gt the follwoing postman output
I managed to get rid of the bug and gt the follwoing postman output
Awesome. I see you got a 404, in your local version, do you have the post route for add_email? If so, do you get the 404 on the health endpoint?
Below we implemented the following changes to the index.py file:
if name == 'main': init_db() app.run(port=3001, debug=True)
we also fixed the postman output for the /api/add_email endpoint
When am in the root directory of our project and run the command
npm run flask-dev
, it runs the script located in the package.json which is:"FLASK_DEBUG=1 pip3 install -r requirements.txt && python3 -m flask --app api/index run -p 3001 --reload"
.Running this command, our endpoints that interact with the database do not work.
When I start the flask api while in the
api
directory withpython3 index.py
, the endpoints that interact with the database work.Here is the response when I do a POST request to the add_email endpoint with
npm run flask-dev
:I am assuming that when I run the app with the flask command, flask skips over the db import, because I also get this error in my terminal:
I want to solve this so that we don't have to change our start script, plus not sure if this would be an issue in production.