Answer the question
In order to leave comments, you need to log in
How to split flask app.py into modules in Zappa?
Hello!
There is app/__init__.py
from flask import Flask
app = Flask(__name__)
class HelloWorldService:
def greeting(self):
print('greeting app')
return 'Hello World'
@app.route('/')
def index():
hello = HelloWorldService()
return hello.greeting(), 200
# include this for local dev
if __name__ == '__main__':
app.run()
from app import app
@app.route('/')
def index():
hello = HelloWorldService()
return hello.greeting(), 200
Answer the question
In order to leave comments, you need to log in
The repository for the example is https://github.com/tonyin/flask-zappa-base.
According to him, I was able to correctly set up the project structure so that flask with blueprints would work successfully with zappa.
Throw out Flask, throw out Zappa, take the Serverless Framework and refuse routing inside the lambda. Get used to AWS API Gateway
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question