Skip to content

Commit

Permalink
styles and pages work, change hrefs and fix photo p3
Browse files Browse the repository at this point in the history
  • Loading branch information
Aweiro committed Oct 30, 2024
1 parent 3765c08 commit 46130fc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
10 changes: 9 additions & 1 deletion js/photos.json
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
[]
[
{
"name": "1730285126685.jpg",
"url": "http://localhost:3000/uploads/1730285126685.jpg",
"description": "wer",
"decorName": "wer",
"price": 234
}
]
4 changes: 2 additions & 2 deletions js/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const upload = multer({ storage: storage });

// Функція для читання photos.json
const readPhotosJson = () => {
const filePath = path.join(__dirname, 'js', 'photos.json');
const filePath = path.join(__dirname, 'photos.json');
if (!fs.existsSync(filePath)) {
fs.writeFileSync(filePath, JSON.stringify([])); // Створити файл, якщо його немає
}
Expand All @@ -47,7 +47,7 @@ const readPhotosJson = () => {

// Функція для запису у photos.json
const writePhotosJson = (photos) => {
const filePath = path.join(__dirname, 'js', 'photos.json');
const filePath = path.join(__dirname, 'photos.json');
fs.writeFileSync(filePath, JSON.stringify(photos, null, 2));
};

Expand Down
Binary file added js/uploads/1730285126685.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 46130fc

Please sign in to comment.