diff --git a/client/src/App.js b/client/src/App.js
index 0308193..154cd00 100644
--- a/client/src/App.js
+++ b/client/src/App.js
@@ -1,5 +1,5 @@
import React from 'react';
-import { BrowserRouter, Route, Routes } from 'react-router-dom';
+import { Route, Routes } from 'react-router-dom';
import './App.css';
import Navigation from './components/Navigation';
import Home from './components/Home';
@@ -15,7 +15,7 @@ import Metric from './components/Metric';
function App() {
return (
-
+
@@ -26,13 +26,10 @@ function App() {
} />
} />
} />
- } /> {/* Replace Home with your actual home component */}
- {/* Add routes for update and create if needed, with corresponding components: */}
- {/* } /> */}
- {/* } /> */}
+ } />
-
+
);
}
diff --git a/client/src/components/Home.js b/client/src/components/Home.js
index 254b518..518c59c 100644
--- a/client/src/components/Home.js
+++ b/client/src/components/Home.js
@@ -1,27 +1,41 @@
-import React from 'react';
+import React, { useEffect, useState } from 'react';
import '../style/home.css';
-import { Link } from 'react-router-dom';
+// import { Link } from 'react-router-dom';
export default function Home() {
- const execCMD = () => {
- // Make a request to the server-side endpoint
- fetch('/rundocker')
- .then(response => {
- if (!response.ok) {
- throw new Error('Network response was not ok');
- }
- return response.text();
- })
- .then(data => {
- console.log(data);
- alert('Command executed successfully');
- })
- .catch(error => {
- console.error('There was a problem with the fetch operation:', error);
- alert('Failed to execute command');
- });
- };
+ const [data, setData] = useState([]);
+ const getDetails = () => {
+ console.log("Working")
+ fetch('/getdata')
+ .then((response) => {
+ return response.json();
+ })
+ .then((data) => {
+ console.log(data);
+ // Handle the fetched data as needed
+ })
+ .catch((error) => {
+ console.error('Error fetching data:', error);
+ // Handle the error appropriately
+ });
+
+ }
+
+// const getDetails = (){
+// console.log("button is working")
+// useEffect(() => {
+// fetch('/getdata')
+// .then((data) => {
+// return data.json()
+// })
+// .then((res) => {
+// console.log(res);
+// setData(res)
+
+// })
+// })
+// }
return (
@@ -35,7 +49,28 @@ export default function Home() {
Docker is a platform designed to help developers build, share, and run container applications. We handle the tedious setup, so you can focus on the code.