From 4ef4badec3a6f6a8b110ab79334a87592cdc59db Mon Sep 17 00:00:00 2001 From: Katalina Okano Date: Sun, 6 Dec 2020 07:24:46 -0500 Subject: [PATCH] expose public URI routes in ui --- next.config.js | 4 ++++ src/pages/auth/login.tsx | 5 ++++- terraform/webapp.tf | 8 ++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/next.config.js b/next.config.js index 91f9e81..7c1d7ba 100644 --- a/next.config.js +++ b/next.config.js @@ -1,3 +1,7 @@ module.exports = { // target: 'serverless', + publicRuntimeConfig: { + apiPublicURI: process.env.API_PUBLIC_URI, + uiPublicURI: process.env.UI_PUBLIC_URI, + }, }; diff --git a/src/pages/auth/login.tsx b/src/pages/auth/login.tsx index eda7e1b..9968f3a 100644 --- a/src/pages/auth/login.tsx +++ b/src/pages/auth/login.tsx @@ -1,6 +1,9 @@ +import getConfig from 'next/config'; import * as React from 'react'; import { AuthLogin } from 'roleypoly/design-system/templates/auth-login'; +const { publicRuntimeConfig } = getConfig(); + const loginPage = () => { const onSendSecretCode = (code: string) => { console.log(code); @@ -8,7 +11,7 @@ const loginPage = () => { return ( ); }; diff --git a/terraform/webapp.tf b/terraform/webapp.tf index 94d6d3e..d9ce768 100644 --- a/terraform/webapp.tf +++ b/terraform/webapp.tf @@ -28,8 +28,16 @@ resource "google_cloud_run_service" "web" { } } } + + metadata { + annotations = { + "autoscaling.knative.dev/maxScale" = "10" + } + } } + + traffic { percent = 100 latest_revision = true