Flytta endepunkter inn i api/
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
</nav>
|
||||
|
||||
<h2>Sett dato og tid startskuddet gikk:</h2>
|
||||
<form action="/config.php" method="POST">
|
||||
<form action="/api/config.php" method="POST">
|
||||
<input style="display: none;" type="text" id="password" name="password" required>
|
||||
<label>
|
||||
Dato og tid
|
||||
@@ -43,7 +43,7 @@
|
||||
|
||||
// Sjekk om brukeren er logga inn. hvis ikke hiv de ut til innloggingskjermen
|
||||
let xmlHttpReq = new XMLHttpRequest();
|
||||
xmlHttpReq.open("POST", "/is_authorized.php", false);
|
||||
xmlHttpReq.open("POST", "/api/is_authorized.php", false);
|
||||
xmlHttpReq.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=UTF-8")
|
||||
xmlHttpReq.send("username=" + localStorage.getItem("navn")+"&"+"password=" + localStorage.getItem("passord"));
|
||||
if (xmlHttpReq.status != 200){
|
||||
@@ -51,7 +51,7 @@
|
||||
}
|
||||
document.getElementById('password').value = localStorage.getItem("passord");
|
||||
|
||||
xmlHttpReq.open("GET", "/config.php", false);
|
||||
xmlHttpReq.open("GET", "/api/config.php", false);
|
||||
xmlHttpReq.send();
|
||||
document.getElementById('start_time').value = xmlHttpReq.response.split('+')[0]
|
||||
console.log(xmlHttpReq.response)
|
||||
|
||||
Reference in New Issue
Block a user