This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Injectable } from '@angular/core' | |
import { ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot, UrlTree } from '@angular/router' | |
import { Observable } from 'rxjs' | |
import { distance } from 'fastest-levenshtein' | |
import { paths } from '../paths' | |
@Injectable({ | |
providedIn: 'root' | |
}) | |
export class Redirect404Guard implements CanActivate { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const AWS = require('aws-sdk'); | |
const ssm = new AWS.SSM({ region: 'eu-central-1' }); | |
const SOURCE_COOKIE_NAME = 'myapp-origin'; | |
const LATEST_ORIGIN_GIT_HASH = 'myapp_latest-origin-git-hash'; | |
exports.handler = async (event, context, callback) => { | |
console.group('[INFO] lambda@edge Viewer Request') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const SOURCE_HEADER_NAME = 'x-myapp-origin'; | |
exports.handler = async event => { | |
console.group('[INFO] lambda@edge Origin Request') | |
const request = event.Records[0].cf.request; | |
if (request.headers[SOURCE_HEADER_NAME]) { | |
const headerValue = request.headers[SOURCE_HEADER_NAME][0].value; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const AWS = require('aws-sdk'); | |
const ssm = new AWS.SSM({ region: 'eu-central-1' }); | |
const SOURCE_COOKIE_NAME = 'myapp-origin'; | |
const LATEST_ORIGIN_GIT_HASH = 'myapp_latest-origin-git-hash'; | |
exports.handler = async event => { | |
console.group('[INFO] lambda@edge Origin Response') |
OlderNewer