This repository has been archived by the owner on May 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 42
/
App.js
105 lines (97 loc) · 3.7 KB
/
App.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
// Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: MIT-0
import React, { Component } from 'react';
import { BrowserRouter, Route } from "react-router-dom";
import Amplify, { Auth } from 'aws-amplify';
import { withAuthenticator, SignIn, ConfirmSignIn, Greetings, VerifyContact, RequireNewPassword, ForgotPassword, Loading } from 'aws-amplify-react';
import MyTheme from "./components/AmplifyTheme";
import { Home } from './pages/Home';
import { Navigation } from './components/Navigation';
import AllEC2 from './pages/AllEC2';
import AllLB from './pages/AllLB';
import AllEBS from './pages/AllEBS';
import AllEKS from './pages/AllEKS';
import AllRDS from './pages/AllRDS';
import AllODCR from './pages/AllODCR';
import AllRis from './pages/AllRis';
import Organizations from './pages/Organizations';
import AllVpcs from './pages/AllVpcs';
import AllNetworkInterfaces from './pages/AllNetworkInterfaces';
import AllSubnets from './pages/AllSubnets';
import Refresh from './pages/Refresh';
import AllData from './pages/AllData';
import AllUsers from './pages/AllUsers';
import AllRoles from './pages/AllRoles';
import AllAttachedPolicys from './pages/AllAttachedPolicys';
import AllLambda from './pages/AllLambda';
import AllS3 from './pages/AllS3';
import AllLightsail from './pages/AllLightsail';
import Table from './pages/Table';
import './index.css';
Amplify.configure({
// OPTIONAL - if your API requires authentication
Auth: {
// REQUIRED - Amazon Cognito Region
region: 'ap-southeast-2',
// OPTIONAL - Amazon Cognito User Pool ID
userPoolId: process.env.REACT_APP_USERPOOL_ID,
// OPTIONAL - Amazon Cognito Web Client ID (26-char alphanumeric string)
userPoolWebClientId: process.env.REACT_APP_USERPOOL_WEB_CLIENT_ID,
},
API: {
endpoints: [
{
name: "MyAPIGatewayAPI",
endpoint: process.env.REACT_APP_APIG_ENDPOINT,
region: 'ap-southeast-2',
custom_header: async () => {
return { Authorization: (await Auth.currentSession()).idToken.jwtToken };
}
}
]
}
});
class App extends Component {
render() {
return (
<BrowserRouter>
<div>
<Navigation />
<Route exact path="/" component={Home} />
<Route path="/allec2" component={AllEC2} />
<Route path="/allLB" component={AllLB} />
<Route path="/allEBS" component={AllEBS} />
<Route path="/alleks" component={AllEKS} />
<Route path="/alllambda" component={AllLambda} />
<Route path="/Table" component={Table} />
<Route path="/allodcr" component={AllODCR} />
<Route path="/organizations" component={Organizations} />
<Route path="/allrds" component={AllRDS} />
<Route path="/allvpcs" component={AllVpcs} />
<Route path="/allnetworkinterfaces" component={AllNetworkInterfaces} />
<Route path="/allsubnets" component={AllSubnets} />
<Route path="/refresh" component={Refresh} />
<Route path="/alldata" component={AllData} />
<Route path="/allusers" component={AllUsers} />
<Route path="/allroles" component={AllRoles} />
<Route path="/allattachedpolicys" component={AllAttachedPolicys} />
<Route path="/allris" component={AllRis} />
<Route path="/alls3" component={AllS3} />
<Route path="/alllightsail" component={AllLightsail} />
</div>
</BrowserRouter>
);
}
}
// * turn off Auth *
// export default App;
// * Turn on Auth *
export default withAuthenticator(App, false, [
<Greetings />,
<SignIn />,
<ConfirmSignIn />,
<VerifyContact />,
<ForgotPassword />,
<RequireNewPassword />,
<Loading />
], null, MyTheme)