Merge pull request #4 from OlaketalAmigo/hexplor_branch

====
This commit is contained in:
H3XploR
2026-01-10 18:48:12 +01:00
committed by GitHub
3 changed files with 5 additions and 4 deletions
+1 -1
View File
@@ -12,7 +12,7 @@ async function startServer()
await createTables();
app.use('/api/auth', authRouter);
app.get('/api/', (req, res) => res.send('Backend running'));
app.get('/api', (req, res) => res.send('Backend running'));
app.listen(3001, () =>
{
+1
View File
@@ -14,6 +14,7 @@ router.post('/register', async(req, res) =>
router.post('/login', async(req, res) =>
{
console.log("received login!");
const {username, password} = req.body;
const result = await authService.login(username, password);
res.status(result.status).json(result.data);
+3 -3
View File
@@ -87,14 +87,14 @@ export class LoginWindow extends fenetre {
}
async connexion() {
const response = await fetch("/api/login", {
const response = await fetch("/api/auth/login", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
username: "nom",
password: "a"
username: this.username.value,
password: this.password.value
})
});