Compare commits
No commits in common. "05bc9c9f826619b2bd5e9c920d19bcd0677ee155" and "12636e9676df0d817f9b2329f48de605a80bb6e0" have entirely different histories.
05bc9c9f82
...
12636e9676
15
API Register.js
Normal file
15
API Register.js
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
const BASE_URL = "http://localhost:3000/api";
|
||||||
|
|
||||||
|
export async function registerRequest(username, password) {
|
||||||
|
try {
|
||||||
|
const response = await fetch(`${BASE_URL}/register`, {
|
||||||
|
method: "POST",
|
||||||
|
headers: { "Content-Type": "application/json" },
|
||||||
|
body: JSON.stringify({ username, password })
|
||||||
|
});
|
||||||
|
return await response.json();
|
||||||
|
} catch (err) {
|
||||||
|
console.error("API register error:", err);
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -44,7 +44,7 @@
|
|||||||
</form>
|
</form>
|
||||||
|
|
||||||
<div class="register-link">
|
<div class="register-link">
|
||||||
Already Have An Account?
|
Already have an account?
|
||||||
<a href="Login.html" id="loginLink">Login</a>
|
<a href="Login.html" id="loginLink">Login</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user