Skip to main content
Build a production-ready data transformation API in under 3 minutes. No infrastructure setup, no complex configuration - just powerful serverless functions that scale automatically.

3 Minutes

From code to live API endpoint

Auto-scaling

Handles 1 to 10,000+ requests instantly

Production Ready

HTTPS, monitoring, and global deployment
Real Business Impact: This isn’t a “hello world” demo. You’ll experience the full power of Ollie Hub’s integration system - enhancing external APIs with custom business logic and data processing. This is the kind of Hub integration that powers production applications.

What You’ll Build

Experience Ollie Hub’s custom integration power. When someone calls JSONPlaceholder through Hub, your function automatically enhances and transforms the response. Original JSONPlaceholder API:
curl "https://jsonplaceholder.typicode.com/posts/1"
Returns basic data:
{
  "userId": 1,
  "id": 1,
  "title": "sunt aut facere repellat provident occaecati excepturi optio reprehenderit",
  "body": "quia et suscipit\nsuscipit recusandae consequuntur expedita et cum\nreprehenderit molestiae ut ut quas totam\nnostrum rerum est autem sunt rem eveniet architecto"
}
Hub-Enhanced Call:
curl "https://hub.ollie.app/https://jsonplaceholder.typicode.com/posts/1"
Your Hub integration transforms it to:
{
  "id": 1,
  "title": "sunt aut facere repellat provident occaecati excepturi optio reprehenderit",
  "content": "quia et suscipit\nsuscipit recusandae...",
  "analytics": {
    "wordCount": 19,
    "readingTimeMinutes": 1,
    "characterCount": 146,
    "estimatedViewTime": "30 seconds"
  },
  "seo": {
    "slug": "sunt-aut-facere-repellat-provident",
    "metaTitle": "sunt aut facere repellat provident - Blog Post",
    "metaDescription": "quia et suscipit suscipit recusandae consequuntur...",
    "canonicalUrl": "https://myblog.com/posts/sunt-aut-facere-repellat-provident"
  },
  "social": {
    "twitterShareUrl": "https://twitter.com/intent/tweet?text=sunt%20aut%20facere...",
    "linkedinShareUrl": "https://linkedin.com/sharing/share-offsite/?url=...",
    "hashtags": ["#blog", "#content", "#reading"]
  },
  "transformedAt": "2024-01-15T10:30:00.000Z"
}

Deploy Your Function

1

Access Ollie Hub

Navigate to admin.ollie.app and sign in with:

GitHub

One-click OAuth for developers

Google

Enterprise SSO ready

Email

Secure magic link authentication
2

Create Your Workspace

  • Organization Setup
  • Project Creation
Quick Organization:
  • Name: Your Company
Pro Tip: Choose a descriptive name - you’ll invite team members here later.
3

Create Request Function

Function Settings:
  • Name: jsonplaceholder-transformer
  • Type: Request Function
  • Trigger Pattern: https://jsonplaceholder.typicode.com/posts/*
  • Memory: 256 MB
  • Timeout: 30 seconds
  • Runtime: Node.js 18.x
Hub Integration: Your function will automatically enhance any calls to JSONPlaceholder posts and transform the response. When someone calls https://hub.ollie.app/https://jsonplaceholder.typicode.com/posts/1, your Hub integration processes it.
Paste this production-ready code:Complete function file:
// TypeScript interfaces
interface Post {
  userId: number;
  id: number;
  title: string;
  body: string;
}

interface EnrichedPost extends Post {
  content: string;
  analytics: {
    wordCount: number;
    readingTimeMinutes: number;
    characterCount: number;
    estimatedViewTime: string;
  };
  seo: {
    slug: string;
    metaTitle: string;
    metaDescription: string;
    canonicalUrl: string;
  };
  social: {
    twitterShareUrl: string;
    linkedinShareUrl: string;
    hashtags: string[];
  };
  transformedAt: string;
}

// Main Hub integration handler
export const handler = async (event: any): Promise<any> => {
  try {
    // First, fetch the original JSONPlaceholder data
    const originalResponse = await fetch(event.url);
    
    if (!originalResponse.ok) {
      return {
        statusCode: originalResponse.status,
        body: 'Post not found'
      };
    }
    
    const originalPost: Post = await originalResponse.json();
    
    // Transform the data with analytics and enrichment
    const enrichedPost = enrichPostData(originalPost);
    
    return {
      statusCode: 200,
      headers: {
        'Content-Type': 'application/json',
        'Access-Control-Allow-Origin': '*',
        'Cache-Control': 'public, max-age=300'
      },
      body: JSON.stringify(enrichedPost)
    };
    
  } catch (error) {
    console.error('Post transformation error:', error);
    return {
      statusCode: 500,
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify({
        error: 'Internal server error',
        timestamp: new Date().toISOString()
      })
    };
  }
};

// Data transformation function
function enrichPostData(post: Post): EnrichedPost {
  const now = new Date().toISOString();
  
  // Generate slug from title
  const slug = post.title.toLowerCase()
    .replace(/[^a-z0-9\s]/g, '')
    .trim()
    .replace(/\s+/g, '-')
    .substring(0, 50);
  
  // Calculate content analytics
  const wordCount = post.body.split(/\s+/).length;
  const readingTimeMinutes = Math.max(1, Math.round(wordCount / 200));
  const characterCount = post.body.length;
  
  // Generate meta description (first 155 chars)
  const metaDescription = post.body.substring(0, 155) + '...';
  
  // Create share URLs
  const encodedTitle = encodeURIComponent(post.title);
  const encodedUrl = encodeURIComponent(`https://myblog.com/posts/${slug}`);
  
  return {
    ...post,
    content: post.body,
    analytics: {
      wordCount,
      readingTimeMinutes,
      characterCount,
      estimatedViewTime: readingTimeMinutes < 2 ? '30 seconds' : `${readingTimeMinutes} minutes`
    },
    seo: {
      slug,
      metaTitle: `${post.title} - Blog Post`,
      metaDescription,
      canonicalUrl: `https://myblog.com/posts/${slug}`
    },
    social: {
      twitterShareUrl: `https://twitter.com/intent/tweet?text=${encodedTitle}&url=${encodedUrl}`,
      linkedinShareUrl: `https://linkedin.com/sharing/share-offsite/?url=${encodedUrl}`,
      hashtags: ['#blog', '#content', '#reading']
    },
    transformedAt: now
  };
}
4

Deploy & Build

Click “Deploy Function” to trigger the build process:
  1. Code Upload: Your function code is securely uploaded
  2. Build Process: Dependencies installed and optimized
  3. Deployment: Function deployed to global infrastructure
  4. Ready for Activation: Function is built and ready to activate
Build Time: First deployment takes 30-60 seconds. Subsequent deploys are faster with caching.
Watch real-time build logs in the deployment panel:
 Code validation passed
 Dependencies installed
 Function packaged
 Function deployed successfully
 Ready for activation
5

Activate Function

Make your function live and ready for requestsAfter successful deployment, your function will show as INACTIVE. Click “Activate Function” to make it live.
Activation Required: Functions are deployed but inactive by default. You must activate them to start receiving traffic.
 Function activated successfully
 Hub integration live: https://hub.ollie.app/https://jsonplaceholder.typicode.com/posts/*
6

Test Hub Integration

After activating your function, your Hub integration is now enhancing JSONPlaceholder calls! When you call the original API through Hub, your transformation runs automatically:
curl "https://hub.ollie.app/https://jsonplaceholder.typicode.com/posts/1"
Hub Integration Magic: Notice you’re calling the exact same JSONPlaceholder URL, but through hub.ollie.app. Your integration automatically enhances and transforms the response without the caller knowing!
Transformed Response:
{
  "userId": 1,
  "id": 1,
  "title": "sunt aut facere repellat provident occaecati excepturi optio reprehenderit",
  "body": "quia et suscipit\nsuscipit recusandae consequuntur expedita et cum\nreprehenderit molestiae ut ut quas totam\nnostrum rerum est autem sunt rem eveniet architecto",
  "content": "quia et suscipit\nsuscipit recusandae consequuntur expedita et cum\nreprehenderit molestiae ut ut quas totam\nnostrum rerum est autem sunt rem eveniet architecto",
  "analytics": {
    "wordCount": 19,
    "readingTimeMinutes": 1,
    "characterCount": 146,
    "estimatedViewTime": "30 seconds"
  },
  "seo": {
    "slug": "sunt-aut-facere-repellat-provident",
    "metaTitle": "sunt aut facere repellat provident occaecati excepturi optio reprehenderit - Blog Post",
    "metaDescription": "quia et suscipit\nsuscipit recusandae consequuntur expedita et cum\nreprehenderit molestiae ut ut quas totam\nnostrum rerum est autem sunt rem...",
    "canonicalUrl": "https://myblog.com/posts/sunt-aut-facere-repellat-provident"
  },
  "social": {
    "twitterShareUrl": "https://twitter.com/intent/tweet?text=sunt%20aut%20facere...",
    "linkedinShareUrl": "https://linkedin.com/sharing/share-offsite/?url=...",
    "hashtags": ["#blog", "#content", "#reading"]
  },
  "transformedAt": "2024-01-15T10:30:00.000Z"
}

Understanding Hub Integrations

The https://hub.ollie.app/ URL enables powerful API customization and transformation through Hub:Original API Call:
GET https://jsonplaceholder.typicode.com/posts/1
Hub-Enhanced Call:
GET https://hub.ollie.app/https://jsonplaceholder.typicode.com/posts/1
What happens behind the scenes:
  1. Pattern Matching: Hub checks if the URL matches your integration’s trigger pattern
  2. Custom Processing: Your Hub function receives the original request and fetches the real data
  3. Transformation: Your function processes and enriches the response
  4. Seamless Response: Caller receives enhanced data, thinking it came from the original API
Real-World Use Cases:
  • API Enhancement: Add analytics, caching, or rate limiting to any API
  • Data Transformation: Convert between API formats or add computed fields
  • Legacy Modernization: Add modern features to old APIs without changing them
  • Multi-source Aggregation: Combine data from multiple APIs into one response
Benefits:
  • Zero Infrastructure: No servers to manage or scale
  • Seamless Integration: Callers don’t know transformation is happening
  • Global Performance: Automatic edge caching and routing
  • Built-in Monitoring: Request logs, error tracking, performance metrics
  • Security: HTTPS by default, input validation, DDoS protection

Function Types & Triggers

Request Functions

Perfect for: APIs, webhooks, real-time processingTrigger: HTTP requests via Hub proxyExamples: User authentication, payment processing, data validationResponse: Immediate HTTP response to caller

Response Functions

Perfect for: Post-processing, notifications, cleanup tasksTrigger: Automatically after Request Functions completeExamples: Send confirmation emails, update analytics, cache invalidationResponse: Runs asynchronously, no direct response to original caller

Task Functions

Perfect for: Scheduled jobs, maintenance, reportsTrigger: Cron expressions (e.g., daily at 9 AM)Examples: Daily reports, data cleanup, inventory syncResponse: Runs on schedule, logs available in dashboard

Production Features

Your function is immediately production-ready with:

Auto-scaling

Handles 1 to 10,000+ concurrent requests automatically

Global Deployment

Available worldwide through edge locations

Real-time Monitoring

Live request logs, error tracking, and performance metrics

Built-in Security

HTTPS by default, input validation, and DDoS protection

Next Steps


Congratulations! You’ve deployed a production-ready API that can handle thousands of requests. Your function is automatically scaling, monitored, and ready to power real applications. View detailed logs and metrics in your Ollie Hub dashboard.