![]() Server : Apache/2 System : Linux server-15-235-50-60 5.15.0-164-generic #174-Ubuntu SMP Fri Nov 14 20:25:16 UTC 2025 x86_64 User : gositeme ( 1004) PHP Version : 8.2.29 Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname Directory : /home/gositeme/domains/lavocat.ca/public_html/ |
const express = require('express');
const path = require('path');
const fs = require('fs');
const app = express();
const PORT = 3447;
// Serve static files from .next/static
app.use('/_next/static', express.static(path.join(__dirname, '.next/static')));
// Serve other static files
app.use('/fonts', express.static(path.join(__dirname, 'public/fonts')));
app.use('/images', express.static(path.join(__dirname, 'public/images')));
app.use('/favicon.ico', express.static(path.join(__dirname, 'public/favicon.ico')));
// Handle all other requests by proxying to the main server
app.use('*', (req, res) => {
// Proxy to the main Next.js server
const https = require('https');
const options = {
hostname: 'localhost',
port: 3446,
path: req.originalUrl,
method: req.method,
headers: req.headers
};
const proxyReq = https.request(options, (proxyRes) => {
res.writeHead(proxyRes.statusCode, proxyRes.headers);
proxyRes.pipe(res);
});
proxyReq.on('error', (err) => {
console.error('Proxy error:', err);
res.status(500).send('Proxy error');
});
if (req.method === 'POST') {
req.pipe(proxyReq);
} else {
proxyReq.end();
}
});
app.listen(PORT, () => {
console.log(`Static file server running on port ${PORT}`);
});