Web Widget
Bài đăng phổ biến từ blog này
const express = require('express'); const axios = require('axios'); const app = express(); const port = 3000; app.use(express.static('public')); app.get('/fetch-website', async (req, res) => { try { const response = await axios.get('http://14.182.164.182:82/awp/control.html'); res.send(response.data); } catch (error) { console.error(error); res.status(500).send('Internal Server Error'); } }); app.listen(port, () => { console.log(`Server is running at http://localhost:${port}`); });
Nhận xét
Đăng nhận xét