diff --git a/aws-lambda/README.md b/aws-lambda/README.md index 3b2e86d..6d5e35c 100644 --- a/aws-lambda/README.md +++ b/aws-lambda/README.md @@ -67,7 +67,7 @@ serverless plugin install -n serverless-wsgi To test the application as a lambda locally: ```bash -serverless wsgi server +serverless wsgi serve ``` To deploy to AWS Lambda: @@ -79,7 +79,7 @@ serverless deploy Once deployed, if you only need to update the code and not anything in the serverless configuration, you can update the function using: ```bash -serverless deploy --function app +serverless deploy function -f app ``` When deployed, the output will show the URL the app has been deployed to. @@ -128,4 +128,4 @@ Deploy stack using serverless. ``` AWS_PROFILE= sls deploy -s -``` \ No newline at end of file +``` diff --git a/aws-lambda/container/.serverless-wsgi b/aws-lambda/container/.serverless-wsgi index 1770c6d..55afd1a 100644 --- a/aws-lambda/container/.serverless-wsgi +++ b/aws-lambda/container/.serverless-wsgi @@ -1 +1,10 @@ -{"app":"pygeoapi/flask_app.APP","text_mime_types":["application/ld+json"]} \ No newline at end of file +{ + "app": "pygeoapi/flask_app.APP", + "text_mime_types": [ + "application/ld+json", + "text/html", + "application/geo+json", + "application/prs.coverage+json", + "application/xml" + ] +} diff --git a/aws-lambda/container/wsgi.py b/aws-lambda/container/wsgi.py index 5c3e748..1c5c201 100644 --- a/aws-lambda/container/wsgi.py +++ b/aws-lambda/container/wsgi.py @@ -1,9 +1,10 @@ import os +from pygeoapi.flask_app import APP + os.environ['PYGEOAPI_CONFIG'] = 'pygeoapi-test-config.yml' os.environ['PYGEOAPI_OPENAPI'] = 'pygeoapi-test-openapi.yml' -from pygeoapi.flask_app import APP if __name__ == "__main__": APP.run()