This repository has been archived by the owner on Apr 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* WIP - Network Error - Missing CORS-Header in BE? * Fixed Pipelines, added featureRelease.yml pipeline. * fixed cors erros, due to missing protocol in url. * Minor changes on first api call example * Deleted unused line Co-authored-by: open-schnick <jonathan.burst@gmx.de>
- Loading branch information
1 parent
6a76730
commit d427601
Showing
11 changed files
with
129 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Latest Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'feature/**' | ||
paths: | ||
- 'webapp_frontend/**' | ||
- 'webapp_provider/**' | ||
|
||
jobs: | ||
Build_Docker_Image_on_Push: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- | ||
name: Set up Project | ||
uses: actions/checkout@v2 | ||
- | ||
name: Set up Node.js environment | ||
uses: actions/setup-node@v2.1.2 | ||
with: | ||
node-version: 12 | ||
- | ||
name: Build frontend | ||
run: | | ||
cd webapp_frontend | ||
npm i | ||
npm run-script build | ||
cp -r build ../webapp_provider/public | ||
- | ||
name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKER_USER }} | ||
password: ${{ secrets.DOCKER_PW }} | ||
- | ||
name: Build and push | ||
run: | | ||
docker build -t filefighter/frontend:feature webapp_provider/ | ||
docker push filefighter/frontend:feature |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import Axios from "axios"; | ||
|
||
const uri = "http://localhost:8080"; | ||
|
||
interface BackendHealthData { | ||
uptimeInSeconds: number | ||
} | ||
|
||
function callBackendHealth():Promise<BackendHealthData>{ | ||
return new Promise((resolve, reject) => { | ||
Axios.get(`${uri}/health`) | ||
.then((data) => { | ||
resolve(data.data); | ||
}) | ||
.catch(((error) => { | ||
reject(error); | ||
})); | ||
}); | ||
} | ||
|
||
export {callBackendHealth} |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import React, {ReactElement, useEffect, useState} from 'react'; | ||
import logo from '../logo.svg'; | ||
import './App.css'; | ||
import {callBackendHealth} from "../api"; | ||
|
||
function App():ReactElement { | ||
const [backendLiveTime, setBackendLiveTime] = useState<number | string>("Init"); | ||
|
||
useEffect(() => { | ||
updateVariables() | ||
}); | ||
|
||
function updateVariables(): void { | ||
Promise.all([callBackendHealth()]) | ||
.then(([backendHealthData]) => { | ||
setBackendLiveTime(backendHealthData.uptimeInSeconds) | ||
}) | ||
} | ||
|
||
return ( | ||
<div className="App"> | ||
<header className="App-header"> | ||
<p> | ||
Hello World | ||
</p> | ||
<img src={logo} className="App-logo" alt="logo"/> | ||
<p> | ||
Edit <code>src/App.tsx</code> and save to reload. | ||
</p> | ||
<a | ||
className="App-link" | ||
href="https://reactjs.org" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
Learn React | ||
</a> | ||
<button style={{marginTop: "20px"}} onClick={() => updateVariables()}>Test</button> | ||
<p>{backendLiveTime}</p> | ||
</header> | ||
</div> | ||
); | ||
} | ||
|
||
export default App; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters