31 lines
736 B
JavaScript
31 lines
736 B
JavaScript
const express = require('express');
|
|
const path = require('path');
|
|
const app = express();
|
|
const PORT = process.env.PORT || 3001;
|
|
const DOMAIN = process.env.DOMAIN || 'homebase.sketchferret.com';
|
|
|
|
// Serve static files from public folder
|
|
app.use(express.static(path.join(__dirname, 'public')));
|
|
|
|
// API endpoint
|
|
app.get('/api/status', (req, res) => {
|
|
res.json({
|
|
message: 'HomeBase is running!',
|
|
domain: DOMAIN,
|
|
timestamp: new Date().toISOString(),
|
|
version: '1.0.0'
|
|
});
|
|
});
|
|
|
|
app.get('/health', (req, res) => {
|
|
res.json({ status: 'healthy' });
|
|
});
|
|
|
|
app.listen(PORT, '0.0.0.0', () => {
|
|
console.log(`Server running on port ${PORT}`);
|
|
console.log(`Domain: ${DOMAIN}`);
|
|
console.log(`Visit: http://${DOMAIN}`);
|
|
});
|
|
|
|
|