What this will cover
- Host a static website at S3
- Redirect
www.website.com
towebsite.com
- Website can be an SPA (requiring all requests to return
index.html
) - Free AWS SSL certs
- Deployment with CDN invalidation
git describe --exact-match --tags 2> /dev/null || git rev-parse --short HEAD |
class ContactFinder { | |
#db; | |
#chatToFind; | |
#dbName = "model-storage"; | |
#chatsCol = "chat"; | |
#contactCol = "contact"; | |
#groupCol = "participant"; | |
constructor(chatGroupName) { | |
this.#chatToFind = chatGroupName; |
# How to consume Github Package private registry with yarn? | |
Create an .npmrc file in the same location as the package.json with this content. | |
``` | |
registry=https://registry.yarnpkg.com/ | |
@<username>:registry=https://npm.pkg.github.com | |
//npm.pkg.github.com/:_authToken=<your auth token> | |
always-auth=true |
#!/bin/sh | |
set -e | |
until psql -d "postgres" -c '\q'; do | |
>&2 echo "Postgres is unavailable - sleeping" | |
sleep 1 | |
done | |
>&2 echo "Ensuring database..." |
package main | |
import ( | |
"bytes" | |
"crypto/aes" | |
"crypto/cipher" | |
"crypto/rand" | |
"errors" | |
"io" | |
"io/ioutil" |
{ | |
"name": "req-dump", | |
"version": "1.0.0", | |
"description": "", | |
"main": "server.js", | |
"bin": "server.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1", | |
"start": "node server.js" | |
}, |
provider "aws" { | |
version = "~> 2.0" | |
region = "eu-west-2" | |
} | |
# Providing a reference to our default VPC | |
resource "aws_default_vpc" "default_vpc" { | |
} | |
# Providing a reference to our default subnets |
'use strict'; | |
/** | |
* Lambda@Edge to log CloudFront event and context. | |
* Note: this runs in Lambda@Edge which means it runs in a variety | |
* of regions, the region closest to the browser making the request. | |
* So be sure and check other regions if you don't see the logs in | |
* CloudWatch in the region you normally use. | |
* | |
* https://medium.com/@jbesw/postcards-from-lambda-the-edge-11a43f215dc1 |
#!/bin/bash | |
# | |
# video conversion script for publishing as HTML 5 video, via videojs (with hd button extension) | |
# 2011 by zpea | |
# feel free to use as public domain / Creative Commons CC0 1.0 (http://creativecommons.org/publicdomain/zero/1.0/) | |
# | |
FFMPEG=/usr/bin/ffmpeg | |
HD_SUFFIX='_hd' |