import * as express from 'express';
import { setupHealthChecks } from './utils/health-check';

const app = express();
const port = 9443;

// Enable CORS
app.use((req, res, next) => {
  res.header('Access-Control-Allow-Origin', '*');
  res.header('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept');
  next();
});

// Setup health check endpoints
setupHealthChecks(app);

// Serve static files from dist directory
app.use(express.static('dist'));

app.listen(port, () => {
  console.log(`Plugin server running at http://localhost:${port}`);
}); 