Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 23 additions & 5 deletions server/client/src/components/TaskBoard/Board.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,35 @@
import "../../styles/Board.css";

import React, { Component } from "react";
import React, { useState , useEffect } from "react";
import Activities from "./Activities";

class Board extends Component {
render() {
const Board = () => {
// fetch here
const [response, setResponse] = useState();

useEffect(() => {
fetch("http://localhost:8080/api/home", {
method: 'GET',
headers: {
'Content-Type' : 'application/json',
'Authorization' : 'Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJudSIsImV4cCI6MTYwNDk3MTM1MSwiaWF0IjoxNjA0MzY2NTUxfQ.IjpsOacMSc_6FKOsJhPEcY64H_RfmppoEn7UK4fmPXGQcthA5I4LqFUr4tXBqBxkdNf8B1xMezV-sQMT_c0n7A',
}
})
.then(resp => resp.text())
.then(text => setResponse(text))
.then(text => console.log(text))
.catch(err => console.log(err))
}, [])




return (
<div className="Board">
{/* <div className="Header">Task Board</div> */}
<div className="Header"> {response}</div>
<Activities />
</div>
);
}
}

export default Board;
1 change: 1 addition & 0 deletions server/client/src/components/TaskBoard/TaskBoard.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import store from "../store";
import "../../styles/TaskBoard.css";

const TaskBoard = () => {

return (
<Provider store={store}>
<Board />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class HomeController {

@GetMapping("/home")
public String getHome() {
return "Testing controller";
return "Testing controller";
}

@GetMapping("/indeed")
Expand Down