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
<button id="trigger-cf">Trigger Cloud Run</button> | |
<div id="firebaseui-auth-container"></div> | |
<script src="https://www.gstatic.com/firebasejs/ui/4.6.1/firebase-ui-auth.js"></script> | |
<link type="text/css" rel="stylesheet" href="https://www.gstatic.com/firebasejs/ui/4.6.1/firebase-ui-auth.css" /> | |
<script> | |
document.addEventListener('DOMContentLoaded', function() { | |
// Initialize the FirebaseUI Widget using Firebase. | |
let ui = new firebaseui.auth.AuthUI(firebase.auth()); | |
ui.start('#firebaseui-auth-container', { | |
signInOptions: [ |
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
# openapi2-functions.yaml | |
swagger: '2.0' | |
info: | |
title: API_ID optional-string | |
description: Sample API on API Gateway with a Google Cloud Functions backend | |
version: 1.0.0 | |
schemes: | |
- https | |
produces: | |
- application/json |
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
def hello_get(request): | |
# Set CORS headers for the preflight request | |
if request.method == 'OPTIONS': | |
# Allows GET requests from any origin with the Content-Type | |
# header and caches preflight response for an 3600s | |
headers = { | |
'Access-Control-Allow-Origin': '*', | |
'Access-Control-Allow-Methods': 'GET,PUT,POST,DELETE,PATCH,OPTIONS,HEAD', | |
'Access-Control-Allow-Headers': 'Content-Type,Authorization', | |
'Access-Control-Max-Age': '3600' |