A simple flask+ react website that i have deployed to App Engine works fine locally. When I serve main.py locally and go to /hello it returns "hello world" as it should. However when deployed to app engine and using the provided URL with /hello it returns "The requested URL /hello was not found on this server."
below is main.py
from flask import Flask, render_template
app = Flask(__name__, static_folder="./build/static", template_folder="./build")
@app.route("/")
def index():
return render_template("index.html")
@app.route("/hello")
def hello():
return "Hello World!"
if __name__ == "__main__":
app.run(host='127.0.0.1', port=8080, debug=True)
here's my app.yaml
runtime: python37
entrypoint: gunicorn -b :$PORT main:app
handlers:
- url: /
static_files: build/index.html
upload: build/index.html
- url: /
static_dir: build
- url: /(.*)
script: auto
project_root/
build/
static/
index.html
app.yaml
main.py
It also returns index.html fine on app engine when entering [provided-url].com/