Public and private services

I have public and private services (less public services than private services) need be set in path.

For public service, it needn’t be authorised.

Public service api gateway

  public:
    handler: public/public.public
    events:
      - http:
          path: {proxy+}
          method: any
          cors: true

Private service api gateway

  private:
    handler: auth/private.private
    events:
      - http:
          path: {proxy+}
          method: any
          cors: true
          authorizer:
            name: auth
            resultTtlInSeconds: 300
            identitySource: method.request.header.Authorization
            type: token

  auth:
    handler: auth/auth.auth

How can I merge them into one api gateway?

Can I have something like this?

events:
  - http:
      path: abc
      method: any
      ....
events:
  - http:
      path: efg
      method: any
      ....
events:
  - http:
      path: {proxy+}    # for rest services if not mentioned in above public path.
      method: any
1 Like