This file contains hidden or 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
--- | |
service: my-lambda-edge | |
provider: | |
name: aws | |
region: us-east-1 # Lambda@Edge need to be in us-east-1 | |
stage: ${opt:stage, 'production'} | |
runtime: nodejs14.x | |
stackName: ${self:service}-${self:provider.stage} |
This file contains hidden or 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'; | |
// Since you may want to have other redirects in the handler this | |
// function will simplify it a bit. | |
function redirect (url) { | |
return Promise.resolve({ | |
body: '', | |
status: '301', | |
statusDescription: 'Permanently moved', | |
headers: { |
This file contains hidden or 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
{ | |
"Records": [ | |
{ | |
"cf": { | |
"config": { | |
"distributionDomainName": "d111111abcdef8.cloudfront.net", | |
"distributionId": "EDFDVBD6EXAMPLE", | |
"eventType": "origin-request", | |
"requestId": "4TyzHTaYWb1GX1qTfsHhEqV6HUDd_BzoBZnwfnvQc_1oF26ClkoUSEQ==" | |
}, |
This file contains hidden or 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
#!/usr/bin/env node | |
const {inspect} = require('util'); | |
const mongoose = require('mongoose'); | |
const DB_NAME = 'selectTest'; | |
const LANGUGAGES = [ | |
{ | |
name: 'Danish', | |
code: 'da', |
This file contains hidden or 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
extends: 'eslint:recommended' | |
env: | |
node: true | |
mocha: true | |
es6: true | |
parserOptions: | |
ecmaVersion: 8 | |
sourceType: module | |
ecmaFeatures: | |
globalReturn: false |
This file contains hidden or 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
h1 You've just sent a Pug email template from URI | |
p this email was sent to | |
a(href="mailto:"+email)=email | |
if amazing | |
p You are amazing! | |
else | |
p You did it! |
This file contains hidden or 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
<h1> You've just sent an HTML template with Underscore</h1> | |
<p> This email was sent to <a href="mailto:<%= email %>">email</a> </p> | |
<% if (amazing) { %> | |
<p>You are amazing!</p> | |
<% } else { %> | |
<p>You did it!</p> | |
<% } %> |
This file contains hidden or 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
<h1> You've just sent an HTML template with Underscore</h1> | |
<p> This email was sent to <a href="mailto:<%= email %>">email</a> </p> | |
<% if (amazing) { %> | |
<p>You are amazing!</p> | |
<% } else { %> | |
<p>You did it!</p> | |
<% } %> |
This file contains hidden or 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
You've just sent a plain text email with Underscore | |
this email was sent to <%= email %> | |
<% if (amazing) { %> | |
You are amazing! | |
<% } else { %> | |
You did it! | |
<% } %> |
This file contains hidden or 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
<h1> You've just sent an HTML template with EJS</h1> | |
<p> This email was sent to <a href="mailto:<%= email %>"><%= email %></a> </p> | |
<% if (amazing) { %> | |
<p>You are amazing!</p> | |
<% } else { %> | |
<p>You did it!</p> | |
<% } %> |
NewerOlder