Fix admin API to serve admin.html on root route
- Updated server.js to serve admin.html on GET / - Fixed path to admin.html in Docker container - Admin panel now accessible at http://<ip>:3000
This commit is contained in:
@@ -8,6 +8,12 @@ const PORT = process.env.PORT || 3000;
|
||||
const JWT_SECRET = process.env.JWT_SECRET || 'fallback-secret-key';
|
||||
const APPS_FILE = path.join(__dirname, 'data', 'apps.json');
|
||||
|
||||
// Serve admin frontend
|
||||
const adminPath = path.join(__dirname, 'admin.html');
|
||||
app.get('/', (req, res) => {
|
||||
res.sendFile(adminPath);
|
||||
});
|
||||
|
||||
app.use(express.json());
|
||||
app.use((req, res, next) => {
|
||||
res.setHeader('Access-Control-Allow-Origin', '*');
|
||||
|
||||
Reference in New Issue
Block a user