Skip to content

Commit 6cabea9

Browse files
committed
Deploy updated build to GitHub Pages
1 parent b361a2a commit 6cabea9

File tree

6 files changed

+315
-27
lines changed

6 files changed

+315
-27
lines changed

.github/workflows/api-proxy.yml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: API Proxy
2+
3+
on: [push]
4+
5+
jobs:
6+
proxy-api:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- name: Set up Node.js
11+
uses: actions/setup-node@v2
12+
with:
13+
node-version: '14'
14+
15+
- name: Run API Proxy Server
16+
run: |
17+
const express = require('express');
18+
const cors = require('cors');
19+
const fetch = require('node-fetch');
20+
const app = express();
21+
22+
app.use(cors());
23+
24+
app.get('/proxy', async (req, res) => {
25+
const apiUrl = 'http://52.66.253.68/asteroidMVC/public/asteroids';
26+
const response = await fetch(apiUrl);
27+
const data = await response.json();
28+
res.json(data);
29+
});
30+
31+
app.listen(3000, () => {
32+
console.log('Proxy running on port 3000');
33+
});

package-lock.json

+212-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"homepage": "https://hb99960.github.io/NEO-Asteroids/",
2+
"homepage": "http://hb99960.github.io/NEO-Asteroids/",
33
"name": "my-app",
44
"version": "0.1.0",
55
"private": true,
@@ -9,6 +9,7 @@
99
"@testing-library/user-event": "^13.5.0",
1010
"chart.js": "^4.4.4",
1111
"react": "^18.3.1",
12+
"react-bootstrap": "^2.10.4",
1213
"react-chartjs-2": "^5.2.0",
1314
"react-dom": "^18.3.1",
1415
"react-scripts": "5.0.1",

public/index.html

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<meta charset="utf-8" />
55
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
66
<meta name="viewport" content="width=device-width, initial-scale=1" />
7+
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
78
<meta name="theme-color" content="#000000" />
89
<meta
910
name="description"

src/components/LineChart.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export default class LineChart extends Component {
1414
console.log("In Line Chart closestAsteroidDistance : ",closestAsteroidDistance);
1515
console.log("In Line Chart averageDiameter : ",averageDiameter);
1616
return (
17-
<div>
17+
<div style={{ width: "100%", height: "400px" }}>
1818
Asteroid Data
1919
<Line
2020
data={{

0 commit comments

Comments
 (0)