Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
myix765 committed Nov 2, 2024
1 parent b640d6a commit 5c0bcc2
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ To run just server:
```
npm run server # in root folder
npm run dev # in backend folder
```

## Git Commands Guide

Expand Down
2 changes: 1 addition & 1 deletion backend/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ app.post('/api/users', async (req, res) => {
// Login

// TODO (Donatello & John): Create an endpoint to receive login data and check if the user exists in the database
app.post('/login', async (req, res) => {
app.post('/api/login', async (req, res) => {
const { username, password } = req.body;

// DEBUG: console.log('Received login request:', username );
Expand Down
Binary file removed src/fonts/AvenirLTStd-Light.otf
Binary file not shown.
6 changes: 3 additions & 3 deletions src/pages/Login.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ export default function Login() {

const handleSubmit = async (e) => {
e.preventDefault();
const { username, password } = formData;
// const { username, password } = formData;
// alert(`Form submitted with\nusername: ${username}\nand password: ${password}`)

try {
const response = await fetch('http://localhost:4000/login', {
const response = await fetch('http://localhost:4000/api/login', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({ username, password }),
body: JSON.stringify(formData),
});

if (response.ok) {
Expand Down

0 comments on commit 5c0bcc2

Please sign in to comment.