Skip to content

Commit

Permalink
road to start render p2
Browse files Browse the repository at this point in the history
  • Loading branch information
Aweiro committed Oct 30, 2024
1 parent f360497 commit caab4df
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions js/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,8 @@ app.use(express.json());

// Налаштування статичних файлів
app.use('/uploads', express.static(path.join(__dirname, 'uploads')));
app.use('/css', express.static(path.join(__dirname, 'css')));
app.use('/img', express.static(path.join(__dirname, 'img')));

// Статичні HTML файли
app.use(express.static(__dirname));
app.use('/css', express.static(path.join(__dirname, '../css')));
app.use('/img', express.static(path.join(__dirname, '../img')));

// Налаштування для зберігання файлів
const storage = multer.diskStorage({
Expand Down Expand Up @@ -55,15 +52,15 @@ const writePhotosJson = (photos) => {

// Маршрути для відображення HTML-сторінок
app.get('/', (req, res) => {
res.sendFile(path.join(__dirname, 'index.html'));
res.sendFile(path.join(__dirname, '../index.html'));
});

app.get('/about', (req, res) => {
res.sendFile(path.join(__dirname, 'about.html'));
res.sendFile(path.join(__dirname, '../about.html'));
});

app.get('/admin', (req, res) => {
res.sendFile(path.join(__dirname, 'admin.html'));
res.sendFile(path.join(__dirname, '../admin.html'));
});

// Обробка запиту на завантаження фото
Expand Down

0 comments on commit caab4df

Please sign in to comment.