Skip to content

Instantly share code, notes, and snippets.

View laurentiuc's full-sized avatar
💭
me.execute( () -> hacking(multiverse) )

Laurentiu laurentiuc

💭
me.execute( () -> hacking(multiverse) )
  • Romania
View GitHub Profile
@nabilfreeman
nabilfreeman / lambda-redirect-to-trailing-slash.js
Last active March 7, 2023 20:31
Redirect to trailing slashes on CloudFront with AWS Lambda. (all this because S3 uses 302 redirects instead of 301)
'use strict';
const path = require('path')
const redirect = new_url => {
return {
status: '301',
statusDescription: 'Moved Permanently',
headers: {
location: [{