Core Concept: Request Interception
How Ollie Hub Works
1
Request Interception
Ollie Hub receives requests intended for your target URL and captures all request details
2
Function Routing
Based on URL patterns and HTTP methods, Hub determines which function should handle the request
3
Code Execution
Your custom function executes with full access to request data and can modify the response
4
Response Enhancement
Optional Response Functions can further modify the output before returning to the user
URL Patterns and Routing
Ollie Hub uses a simple proxy pattern to intercept requests:
Error Handling & Policies
Understanding how Ollie Hub handles function failures is crucial for building reliable applications. Each function can be configured with an error policy that determines what happens when execution fails.Skip Policy
Behavior: Continue execution even if function fails
Use Case: Non-critical functions (analytics, logging, enhancements)
Impact: Request processing continues normally
Status: Function marked as
skipped
Throw Policy
Behavior: Stop execution and return error if function fails
Use Case: Critical functions (authentication, validation, security)
Impact: Request fails with error response Status: Function marked as
Impact: Request fails with error response Status: Function marked as
failed
Error Policy Best Practices:
- Use
throw
for authentication, validation, and security functions - Use
skip
for analytics, logging, and enhancement functions - Consider the impact on user experience when choosing policies
When functions have different error policies, the Hub handles them intelligently:Key Points:
- Request Functions: Execute sequentially, failures can stop the chain
- Response Functions: Execute in parallel, failures are handled independently
- Mixed Policies: Each function’s policy is evaluated individually
Important: Functions with
throw
policy will prevent subsequent functions from executing. Always consider the order and error policies when designing your function chain.Next Steps
Request Functions
Learn to handle HTTP requests and build APIs
Response Functions
Enhance responses with custom logic
Task Functions
Automate workflows with scheduled tasks
Local Development
Test and debug functions locally
Best Practices
Follow proven patterns and optimizations
Key Insight: Ollie Hub acts as an intelligent proxy that intercepts your requests and executes custom code seamlessly. Understanding this flow helps you build more efficient and reliable functions.