Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

235
Views
using lambda@edge for a URL to show calendly page

I have a change request for a static website that is live on AWS cloudfront.

Basically in the page there's a link to https://example.com/schedule

if the user clicks on that link we want it to show a page on calendly in the form https://calendly.com/company/schedule

I wouldn't have a clue where to start with this. Any suggestions?

this is what I got so far, calling callback as I see on many tutorials doesn't seem to work. also on AWS the tutorials fail to build.

'use strict';

function handler(event, context, callback) {
    var uri = event.request.uri
    console.log(uri);
    
    //if URI matches to 'pretty-url' then redirect to a different URI   
    if(uri == "/schedule"){
        console.log('it\'s schedule');
        //Generate HTTP redirect response to a different landing page.
        var redirectResponse = {
            status: '301',
            statusDescription: 'Moved Permanently',
            headers: {
              'location': [{
                key: 'Location',
                value: 'https://calendly.com/company/schedule',
              }],
              'cache-control': [{
                key: 'Cache-Control',
                value: "max-age=7200"
              }],
            },
        };
        console.log(redirectResponse);
        // callback(null, redirectResponse);
        console.log('returning');
        return event.response;
    } else {
        // for all other requests proceed to fetch the resources
        return event.request;
    }
};
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!