import 'dotenv/config'; import express from 'express'; import v1Router from './api/v1/index.mjs'; const app = express(); const PORT = parseInt(process.env.PORT || '3100', 10); app.use(express.json({ limit: '10mb' })); app.use((_req, res, next) => { res.setHeader('Access-Control-Allow-Origin', '*'); res.setHeader('Access-Control-Allow-Methods', 'GET, POST, OPTIONS'); res.setHeader('Access-Control-Allow-Headers', 'Content-Type, Authorization'); next(); }); app.use('/v1', v1Router); app.get('/', (_req, res) => { res.json({ ok: true, service: 'aamos-api-v1', version: '1.0.0', endpoints: '/v1/*' }); }); app.get('/health', (_req, res) => { res.json({ ok: true, service: 'aamos-api-v1', status: 'operational' }); }); const server = app.listen(PORT, '127.0.0.1', () => { console.log(`[AAMOS-API-v1] Server running on http://127.0.0.1:${PORT}`); }); // Keep alive setInterval(() => {}, 1000);