404 with flask app using gunicorn

gkatsikis
HOBBY

7 months ago

I have successfully launched my flask backend using gunicorn with a Procfile:

web: gunicorn run:app --bind 0.0.0.0:$PORT

I have set the generate domain option with the port recommended (8080) under public networking.

The deployment logs state it is listening:

[2024-11-14 15:29:05 +0000] [1] [INFO] Starting gunicorn 23.0.0

Nov 14 10:29:06

[2024-11-14 15:29:05 +0000] [1] [INFO] Listening at: http://0.0.0.0:8080 (1)

Nov 14 10:29:06

[2024-11-14 15:29:05 +0000] [1] [INFO] Using worker: sync

Nov 14 10:29:06

[2024-11-14 15:29:05 +0000] [4] [INFO] Booting worker with pid: 4

I have tried a few options and I'm not quite sure where to go from here. I either get a 404 or the 'Application failed to respond' error and I'm not sure what to do to set up my backend, let alone allow the front end to make api calls to it.

Any advice would be appreciated.

Solved

3 Replies

7 months ago

Hello,

404 at the root of an API is perfectly normal.

What issues are you actually experiencing?


gkatsikis
HOBBY

7 months ago

Yeah sorry, I have totally missed my endpoint and was misspelling it. Thank you for your help.


7 months ago

No worries!


Status changed to Solved brody 7 months ago


404 with flask app using gunicorn - Railway Help Station