Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

242
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda