I'm using flask with passenger_wsgi and I can only get the default '/' route to work so my app.py looks like:
import os
from flask import Flask, request, render_template, redirect, url_for
project_root = os.path.dirname(os.path.realpath('__file__'))
template_path = os.path.join(project_root, 'app/templates')
static_path = os.path.join(project_root, 'app/static')
app = Flask(__name__, template_folder=template_path, static_folder=static_path)
@app.route('/')
def index():
return 'Hello, World'
@app.route('/inplay')
def getInPlay():
return 'This is a test'
if __name__ == '__main__':
app.run()
and passenger_wsgi.py looks like
import os
import sys
import importlib.util
sys.path.insert(0, os.path.dirname(os.path.realpath('__file__')))
spec = importlib.util.spec_from_file_location("wsgi", "app.py")
wsgi = importlib.util.module_from_spec(spec)
spec.loader.exec_module(wsgi)
application = wsgi.app
If I got to my url with just api/ at the end it works and shows hello world, if I do api/inplay it 404s, not sure what I'm missing? thanks