Initial commit
This commit is contained in:
15
frontend/dashboard/index.js
Normal file
15
frontend/dashboard/index.js
Normal file
@@ -0,0 +1,15 @@
|
||||
class DataFetcher {
|
||||
constructor() {
|
||||
this.greetingText = document.getElementById("data");
|
||||
this.init();
|
||||
}
|
||||
|
||||
async init() {
|
||||
const reponse = await fetch("/api/dashboard");
|
||||
this.data = await reponse.json();
|
||||
|
||||
this.greetingText.innerText = `Hallo ${this.data.fullName ? this.data.fullName : this.data.username}, starte hier Double-Snake!`
|
||||
}
|
||||
}
|
||||
|
||||
new DataFetcher();
|
||||
Reference in New Issue
Block a user