const express = require('express'); const dotenv = require('dotenv'); const { createProxyMiddleware } = require('http-proxy-middleware'); const app = express(); dotenv.config(); const apiProxy = createProxyMiddleware('/api', { target: process.env.TARGET, changeOrigin: true, }); app.use('/api', apiProxy); app.use('/', express.static(__dirname)); const port = process.env.PORT; app.listen(port, () => { console.log(`Server running on port: ${port}`); });