type: express  # Defines the type of event source (Express.js HTTP server)
port: 3000     # The port on which the HTTP service runs

# Base URL for the HTTP service (Uncomment to enable), All API endpoints will be prefixed with this URL
# base_url: /api/v1 

# Basic Swagger Setup
docs:
  endpoint: /api-docs   # the url on which the service will start
  info:   # info object as per swagger 3.0 spec
    title: Sample Helloworld App
    version: 1.1.0
    summary: Some http calls
    description: Lets play with Godspeed
    contact:
      name: API Support
      url: 'http://www.helloworld.com/support'
      email: support@helloworld.com
    license:
      name: Apache 2.0
      url: 'https://www.apache.org/licenses/LICENSE-2.0.html'
  servers:
    - url: 'http://localhost:3000'
      description: Public API server
    - url: 'http://localhost:3001'
      description: Internal API server

request_body_limit: 20000   # set maximum size of the request body in bytes
file_size_limit: 50000      # set max file upload size in bytes (default is 50 mb)

# set jwt authn to run by default on every event
# authn:
#   jwt:
#     secretOrKey: mysecret #the secret
#     audience: mycompany #aud in jwt token
#     issuer: mycompany #iss in jwt token

# Authorization Policies (Uncomment to enforce role-based access control)
# Requires JWT authentication or another middleware setting up `inputs.user.role`
# authz:
#   - id: check_user_role  # Unique ID for this authorization rule
#     fn: com.gs.transform  # Godspeed function to evaluate authorization logic
#     args: <%inputs.user.role === 'admin'%>  # Example: Allow only admin users

# Authorization can also be handled via a predefined workflow:
# authz: authz.check_user  # Reference a workflow inside the functions folder

# Handling Validation Errors
on_request_validation_error: validations.request.standardResponse
on_response_validation_error: validations.response.standardResponse

# Alternatively, define custom error handling logic inline
# on_response_validation_error:
#   - id: response_validation_error_handler
#     fn: com.gs.return
#     args:
#       success: false
#       code: 500
#       data:
#         message: <% inputs.validation_error.data.message %>
