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
function ecr_login -d \ | |
"ecr_login [profile_name] [region]: Log in to ECR via the AWS CLI." \ | |
-a profile_name region | |
set -l args | |
if [ -n "$profile_name" ] | |
set args $args "--profile=$profile_name" | |
end | |
if [ -n "$region" ] | |
set args $args "--region=$region" |
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
# Login to ECR, optionally specifying a profile namd and region. | |
ecr_login () { | |
local profile_name="$1" | |
local region="$2" | |
local args=() | |
if [ -n "$profile_name" ]; then | |
args=("${args[@]}" "--profile=$profile_name") | |
fi | |
if [ -n "$region" ]; then | |
args=("${args[@]}" "--region=$region") |
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
FROM node:12.5.0-stretch-slim | |
# Install tini, per best-practices. See: | |
# https://github.com/nodejs/docker-node/blob/master/docs/BestPractices.md#handling-kernel-signals | |
ARG TINI_VERSION=v0.18.0 | |
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini | |
RUN chmod +x /tini | |
ENTRYPOINT ["/tini", "--"] | |
WORKDIR /app |
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"; | |
exports.render = function (request, response) { | |
response.send("Hello from the clouds!") | |
} |
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
const path = require('path') | |
const webpack = require('webpack') | |
const nodeExternals = require("webpack-node-externals") | |
module.exports = { | |
target: 'node', | |
node: { | |
__dirname: false | |
}, | |
entry: ['./index.js'], | |
externals: [nodeExternals()], |
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
... | |
module: { | |
rules: [{ | |
test: /\.js?$/, | |
loader: 'babel-loader', | |
options: { | |
presets: ["@babel/react", ["@babel/preset-env", {"modules": false}]] | |
}, | |
exclude: /node_modules/ | |
}] |
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
import fs from "fs"; | |
import path from "path"; | |
import React from "react"; | |
import ReactDOMServer from "react-dom/server"; | |
import App from "./app"; | |
const htmlData = ` | |
<html> | |
<head> | |
<meta charset="utf-8"> |
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
import React from 'react' | |
import { render, hydrate } from 'react-dom' | |
import App from './components/App' | |
hydrate(<App />, document.getElementById('root')) |
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
import React from 'react' | |
const styles = { | |
titleBar: { | |
backgroundColor: 'black', | |
color: 'white' | |
}, | |
date: { | |
color: 'blue', | |
backgroundColor: 'gray', | |
textAlign: 'center' |
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
// Save the initial app so we can remove it from the server when | |
// there are Webpack Hot Module Reload updates. | |
let currentApp = initialApp | |
if (module.hot) { | |
module.hot.accept('../index.js', () => { | |
// Create a new Express app with the updated Cloud Function | |
// handlers. | |
const newApp = setUpApp(require('../index.js')) | |
// Remove the old Express app. |
NewerOlder