Skip to content

Commit

Permalink
finished backend for login,registration, and all 6 outfit pages
Browse files Browse the repository at this point in the history
  • Loading branch information
N-A-V-I-D committed Mar 28, 2024
1 parent a87bed8 commit a4e9a2b
Show file tree
Hide file tree
Showing 19 changed files with 116 additions and 5 deletions.
Binary file added back-end/public/accessories/accessory_1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added back-end/public/accessories/accessory_2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added back-end/public/accessories/accessory_3.webp
Binary file not shown.
Binary file added back-end/public/jackets/jacket_1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added back-end/public/jackets/jacket_2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added back-end/public/jackets/jacket_3.webp
Binary file not shown.
Binary file added back-end/public/pants/brown_pants.webp
Binary file not shown.
Binary file added back-end/public/pants/comfy.webp
Binary file not shown.
Binary file added back-end/public/pants/extra_pants.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file added back-end/public/shoes/shoes_1.avif
Binary file not shown.
Binary file added back-end/public/shoes/shoes_2.webp
Binary file not shown.
Binary file added back-end/public/shoes/shoes_3.webp
Binary file not shown.
Binary file added back-end/public/skirts/skirt_1.webp
Binary file not shown.
Binary file added back-end/public/skirts/skirt_2.webp
Binary file not shown.
Binary file added back-end/public/skirts/skirt_3.webp
Binary file not shown.
121 changes: 116 additions & 5 deletions back-end/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,110 @@ const shirts = [
{ name: 'Casual Shirt',
brand: 'Awesome Brand',
type: 'Casual',
img: '/public/casual_shirt.webp'
img: '/public/shirts/casual_shirt.webp'
},
{ name: 'Formal Shirt',
brand: 'Formal Brand',
type: 'Formal',
img: '/public/formal_shirt.webp'
img: '/public/shirts/formal_shirt.webp'
},
{ name: 'Favorite Shirt',
brand: 'Awesome Brand',
type: 'Casual',
img: '/public/favorite_shirt.webp'
img: '/public/shirts/favorite_shirt.webp'
}
]

const pants = [
{ name: 'Casual Pants',
brand: 'Awesome Brand',
type: 'Casual',
img: '/public/pants/brown_pants.webp'
},
{ name: 'Least Favorite Pants',
brand: 'Fake Brand 3',
type: 'Casual',
img: '/public/pants/extra_pants.jpg'
},
{ name: 'Favorite Pants',
brand: 'Cool Brand',
type: 'Casual',
img: '/public/pants/comfy.webp'
}
]

const skirts = [
{ name: 'Best Dress',
brand: 'Awesome Brand',
type: 'Formal',
img: '/public/skirts/skirt_1.webp'
},
{ name: 'Least Favorite Dress',
brand: 'Fake Brand 170',
type: 'Formal',
img: '/public/skirts/skirt_2.webp'
},
{ name: '2nd Favorite Dress',
brand: 'Cool Brand',
type: 'Formal',
img: '/public/skirts/skirt_3.webp'
}
]

const jackets = [
{ name: 'Ugly Jacket',
brand: 'Awful Brand',
type: 'Casual',
img: '/public/jackets/jacket_1.jpg'
},
{ name: 'Coolest Jacket',
brand: 'Fake Brand 170',
type: 'Formal',
img: '/public/jackets/jacket_2.jpg'
},
{ name: 'Okay Jacket',
brand: 'Cool Brand',
type: 'Casual',
img: '/public/jackets/jacket_3.webp'
}
]

const shoes = [
{ name: 'Nice Shoes',
brand: 'Definitely Awesome',
type: 'Casual',
img: '/public/shoes/shoes_1.avif'
},
{ name: 'Decent Shoes',
brand: 'Definitely Awesome',
type: 'Casual',
img: '/public/shoes/shoes_2.webp'
},
{ name: 'Okay Shoes',
brand: 'Definitely Awesome',
type: 'Casual',
img: '/public/shoes/shoes_3.webp'
}
]

const accessories = [
{ name: 'Most Expensive',
brand: 'Cheap-O',
type: 'Formal',
img: '/public/accessories/accessory_1.jpg'
},
{ name: 'Best Accessory',
brand: 'Definitely Awesome',
type: 'Casual',
img: '/public/accessories/accessory_2.jpg'
},
{ name: 'Pretty Cool',
brand: 'Definitely Awesome',
type: 'Casual',
img: '/public/accessories/accessory_3.webp'
}
]

server.post('/login', (req,res) => {
const loginSuccessful = {
'loggedIn': true
Expand Down Expand Up @@ -70,10 +161,30 @@ server.post('/register', (req,res) => {
})

server.get('/shirts', (req,res) =>{
console.log('shirt get reuqest receievd');
return res.json(shirts)
return res.json(shirts);
})

server.get('/pants', (req,res) => {
return res.json(pants);
})

server.get('/skirts', (req,res) => {
return res.json(skirts);
})

server.get('/jackets', (req,res) => {
return res.json(jackets);
})

server.get('/shoes', (req,res) => {
return res.json(shoes);
})

server.get('/accessories', (req,res) => {
return res.json(accessories);
})


const listener = server.listen(port, function () {
console.log(`Server running on port: ${port}`)
})
Expand Down

0 comments on commit a4e9a2b

Please sign in to comment.