Skip to content

Commit

Permalink
updated fetch request in front-end
Browse files Browse the repository at this point in the history
  • Loading branch information
Elliot Kim authored and Elliot Kim committed Nov 16, 2018
1 parent 5f3f077 commit c8feb40
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 11 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ WORKDIR /usr/src/app

# install app dependencies
COPY package*.json ./
RUN npm run build
RUN npm install

# bundle app source
COPY . .

# bind to port 8080
# bind to port 3000
EXPOSE 3000
CMD ["npm", "run", "server"]
12 changes: 12 additions & 0 deletions aws-auth-cm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: aws-auth
namespace: kube-system
data:
mapRoles: |
- rolearn: <ARN of instance role (not instance profile)>
username: system:node:{{EC2PrivateDNSName}}
groups:
- system:bootstrappers
- system:nodes
2 changes: 1 addition & 1 deletion dist/main.js

Large diffs are not rendered by default.

24 changes: 24 additions & 0 deletions fabric8-rbac.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# NOTE: The service account `default:default` already exists in k8s cluster.
# You can create a new account following like this:
#---
#apiVersion: v1
#kind: ServiceAccount
#metadata:
# name: <new-account-name>
# namespace: <namespace>

---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: fabric8-rbac
subjects:
- kind: ServiceAccount
# Reference to upper's `metadata.name`
name: default
# Reference to upper's `metadata.namespace`
namespace: default
roleRef:
kind: ClusterRole
name: cluster-admin
apiGroup: rbac.authorization.k8s.io
6 changes: 1 addition & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@
"build": "webpack --mode production",
"server": "node src/server/server.js"
},
"proxy": {
"/api": {
"target": "http://localhost:3000"
}
},
"author": "",
"license": "ISC",
"dependencies": {
Expand Down Expand Up @@ -45,6 +40,7 @@
"babel-preset-react": "^6.24.1",
"css-loader": "^1.0.0",
"html-webpack-plugin": "^3.2.0",
"jest": "^23.6.0",
"node-sass": "^4.9.4",
"nodemon": "^1.18.5",
"sass-loader": "^7.1.0",
Expand Down
1 change: 0 additions & 1 deletion src/client/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import { createMuiTheme } from '@material-ui/core/styles';
import GithubCorner from 'react-github-corner'
import blue from '@material-ui/core/colors/blue';


// const theme = createMuiTheme({
// typography: {
// useNextVariants: true,
Expand Down
6 changes: 3 additions & 3 deletions src/client/supplement/fetch.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@

export default (nodes, edges, graph, that) => {
// this fetch receives the pod list
fetch('http://localhost:3000/api/pod')
fetch('http://localhost:3000/pod')
.then((podData) => {
// console.log(data);
return podData.json();
})
.then((podObject) => {
// this fetch receives the service list
fetch('http://localhost:3000/api/service')
fetch('http://localhost:3000/service')
.then((serviceData) => {
return serviceData.json();
})
.then((serviceObject) => {
console.log('serviceobject',serviceObject);
fetch('http://localhost:3000/api/ingress')
fetch('http://localhost:3000/ingress')
.then((ingressData) => {
return ingressData.json();
})
Expand Down

0 comments on commit c8feb40

Please sign in to comment.