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 GOOGLE_CLIENT_ID = process.env.REACT_APP_CLIENTID; | |
const GOOGLE_API_KEY = process.env.REACT_APP_APIKEY; | |
const DISCOVERY_DOCS = [ | |
'https://www.googleapis.com/discovery/v1/apis/drive/v3/rest', | |
]; | |
const SCOPES = 'https://www.googleapis.com/auth/drive.file'; | |
const UPLOAD_URL = 'https://www.googleapis.com/upload/drive/v3/files'; | |
const UPLOAD_PARAMS = '?uploadType=multipart&fields=id'; |
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, { createContext, useReducer, useEffect } from 'react'; | |
import { init, signIn, signOut } from './google-auth'; | |
const AuthStateContext = createContext(); | |
function authReducer(state, action) { | |
console.log('authReducer', state, action); | |
switch (action.type) { | |
case 'SIGN_IN': { |
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
/* eslint-disable no-undef */ | |
const config = { | |
clientId: process.env.REACT_APP_CLIENTID, | |
scope: 'profile email', | |
}; | |
export function init(onInit) { | |
if (!gapi) { | |
throw new Error('Google API SDK is not loaded.'); |
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 { API, Auth } from 'aws-amplify'; | |
const apiName = 'amplifytest01api'; | |
const apiPath = '/todos'; | |
const userIdPrefix = 'user:'; | |
const defaultOptions = { | |
headers: {}, | |
response: true, | |
}; |
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 AWS = require('aws-sdk'); | |
var awsServerlessExpressMiddleware = require('aws-serverless-express/middleware'); | |
var bodyParser = require('body-parser'); | |
var express = require('express'); | |
//(中略) | |
const userIdPresent = true; | |
const partitionKeyName = 'pk'; | |
const partitionKeyType = 'S'; |
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 Amplify from 'aws-amplify'; | |
import { AmplifyAuthenticator, AmplifySignUp } from '@aws-amplify/ui-react'; | |
import awsconfig from '../aws-exports'; | |
import { MyLayout } from '../components/MyLayout'; | |
import { TodoApp } from '../components/TodoApp'; | |
Amplify.configure(awsconfig); | |
const contentStyle = { | |
paddingLeft: '0', |
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 Amplify from 'aws-amplify'; | |
import { AmplifyAuthenticator, AmplifySignOut } from '@aws-amplify/ui-react'; | |
import awsconfig from '../aws-exports'; | |
import { MyLayout } from '../components/MyLayout'; | |
Amplify.configure(awsconfig); | |
const contentStyle = { | |
paddingLeft: '0', |
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
{ | |
"compilerOptions": { | |
"target": "es5", | |
"lib": ["dom", "esnext", "webworker"], | |
"allowJs": false, | |
"skipLibCheck": true, | |
"esModuleInterop": true, | |
"listEmittedFiles": true, | |
"allowSyntheticDefaultImports": true, | |
"strict": true, |
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
export default { | |
getSiteData: () => ({ | |
siteTitle: 'Example Site', | |
gaID: 'UA-222333XXX-1' | |
}), | |
getRoutes: async () => { | |
//(... omitted ...) | |
} | |
}; |
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 App = () => ( | |
<React.Fragment> | |
<GoogleAnalytics /> | |
<Router> | |
(...) | |
</Router> | |
</React.Fragment> | |
); |
NewerOlder