Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

243
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda