aizu's Knowledge Base
    • Go to: aizu.my Homepage
    • Recent
    • Tags
    • Register
    • Login

    AWS Lambda - redirect URL

    Ref
    1
    1
    82
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A
      aizu
      last edited by

      To redirect URL using Lambda (and API Gateway)

      export const handler = async(event) => {
      
          let redirectionUrl = "https://www.google.com";
          
          /*
          302 status is temporarily redirect
          301 status is permenent redirect
          */
          
          const response = {
              statusCode: 302,
              headers: {
                  Location: redirectionUrl,
              }
          };
          return response;
      
      };
      
      1 Reply Last reply Reply Quote 0
      • First post
        Last post