mirror of
https://github.com/eledio-cloud/standard-redirects-for-cloudfront.git
synced 2025-10-30 16:12:30 +01:00
Runtime updated to nodejs10.x
This commit is contained in:
18
README.md
18
README.md
@@ -10,11 +10,11 @@ URI paths that do not have an extension and do not end with a "/" are redirected
|
||||
|
||||
## Examples
|
||||
|
||||
/foo/bar/ -> internal redirect -> /foo/bar/index.html
|
||||
/foo -> external redirect (301) -> /foo/ -> internal redirect -> /foo/index.html
|
||||
/foo.html -> no redirect
|
||||
/foo/bar.html -> no redirect
|
||||
/foo/index.html -> external redirect (301) -> /foo/
|
||||
/foo/bar/ -> internal redirect -> /foo/bar/index.html
|
||||
/foo -> external redirect (301) -> /foo/ -> internal redirect -> /foo/index.html
|
||||
/foo.html -> no redirect
|
||||
/foo/bar.html -> no redirect
|
||||
/foo/index.html -> external redirect (301) -> /foo/
|
||||
|
||||
## Notes
|
||||
|
||||
@@ -26,6 +26,12 @@ Make sure that your CloudFront distribution handles the URL "/" directly by havi
|
||||
|
||||
## Updating
|
||||
|
||||
### Lambda Runtime
|
||||
|
||||
This package uses the `nodejs10.x` Node.js 10 Runtime. Updating the package in your AWS account requires one manual step, which is outlined below.
|
||||
|
||||
### Procedure
|
||||
|
||||
1. Install the application "standard-redirects-for-cloudfront".
|
||||
2. Go to the Cloudformation Console
|
||||
3. Select the Output Value, this is the ARN (including the version) for the Lambda function.
|
||||
@@ -69,7 +75,7 @@ Make sure that your CloudFront distribution handles the URL "/" directly by havi
|
||||
|
||||
For any questions or comments, do contact us!
|
||||
|
||||
Email: contact@digital-sailors.de
|
||||
Email: contact@digital-sailors.de
|
||||
Web: https://www.digital-sailors.de/
|
||||
|
||||
Enjoy!
|
||||
|
||||
4
index.js
4
index.js
@@ -1,7 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
/*
|
||||
Copyright 2017 DigitalSailors e.K.
|
||||
Copyright 2017-2019 DigitalSailors e.K.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
exports.handler = (event, context, callback) => {
|
||||
const request = event.Records[0].cf.request;
|
||||
|
||||
|
||||
let prefixPath; // needed for 2nd condition
|
||||
|
||||
if (request.uri.match('.+/$')) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "standard-redirects-for-cloudfront",
|
||||
"version": "1.3.1",
|
||||
"version": "1.4.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user