Hello,
After following the directions on this custom domain article, I was able to setup custom domain for my flask service which I created by following this article: https://serverless.com/blog/flask-python-rest-api-serverless-lambda-dynamodb/
My serverless.yml is as following:
service: fleet-api
app: fleet-api
plugins:
- serverless-python-requirements
- serverless-wsgi
- serverless-domain-manager
provider:
name: aws
runtime: python3.6
stage: dev
region: eu-central-1
environment:
SERVICE_NAME: ${self:service}
functions:
app:
handler: wsgi_handler.handler
events:
- http: 'GET /'
- http: 'GET /users'
custom:
stage: ${opt:stage, self:provider.stage}
wsgi:
app: main.app
packRequirements: false
pythonRequirements:
dockerizePip: non-linux
domains:
prod: api.mydomain.com
dev: staging-api.mydomain.com
customDomain:
domainName: ${self:custom.domains.${self:custom.stage}}
basePath: 'fleet'
stage: ${self:provider.stage}
createRoute53Record: true
When I leave basePath empty instead of ‘fleet’, I am able to get results from my endpoints but when I wanna fill it with fleet
, I get the following response:
# Not Found
The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.
Any idea what’s wrong in my setup?