I have a test api with no authentication. Everything works with gets and using internal calls, but when I create usable endpoints I get 403 errors. Here are the urls that work (using httpie). I have included the get calls to show the endpoints do work.
http get https://9lu88q2p7i.execute-api.us-east-1.amazonaws.com/staging/test
http post https://9lu88q2p7i.execute-api.us-east-1.amazonaws.com/staging/test
http get https://staging.patternmaker.cc/api/test
The following call does not work
http post https://staging.patternmaker.cc/test
My serverless.yml looks like
service: reg-web
provider:
name: aws
runtime: nodejs6.10
stage: staging
region: us-east-1
functions:
get_test:
# handler: register.register
handler: api.get_test
events:
- http:
path: test
method: get
cors: true
post_test:
handler: api.post_test
events:
- http:
path: test
method: post
cors: true
plugins:
- serverless-webpack
- serverless-domain-manager
custom:
myStage: ${opt:stage, self:provider.stage} # myStage = --stage CLI option || provider.stage
webpackIncludeModules: true
domain:
staging: 'staging.patternmaker.cc'
production: 'reg.patternmaker.cc'
customDomain:
domainName: ${self:custom.domain.${opt:stage}} # 'reg.patternmaker.cc'
basePath: 'api' # This will be prefixed to all routes
stage: ${opt:stage} # ${self:provider.stage}
createRoute53Record: true