Extracted wakeup function

This commit is contained in:
JKamsker 2022-09-18 23:37:29 +02:00
parent 88b10d44ab
commit d6e7b814d4

View file

@ -12,9 +12,7 @@ import {
GoogleReCaptcha, GoogleReCaptcha,
} from 'react-google-recaptcha-v3' } from 'react-google-recaptcha-v3'
fetch(`${process.env.REACT_APP_APISERVER}/api/v2/WakeUpNeo`).then((data) => WakeUp();
console.log('Woke up, im ready to serve :D'),
)
ReactGA.initialize('UA-174657678-1') ReactGA.initialize('UA-174657678-1')
ReactGA.pageview(window.location.pathname + window.location.search) ReactGA.pageview(window.location.pathname + window.location.search)
@ -45,3 +43,13 @@ ReactDOM.render(
// unregister() to register() below. Note this comes with some pitfalls. // unregister() to register() below. Note this comes with some pitfalls.
// Learn more about service workers: https://bit.ly/CRA-PWA // Learn more about service workers: https://bit.ly/CRA-PWA
serviceWorker.unregister() serviceWorker.unregister()
async function WakeUp() {
try{
await fetch(`${process.env.REACT_APP_APISERVER}/api/v2/WakeUpNeo`)
console.log("Woke up")
}catch(ex){
console.log("Error occured: "+ ex)
}
}