feat: add Express API base structure

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Consultoria AS
2026-01-22 01:50:22 +00:00
parent 830e98625d
commit af617627a4
7 changed files with 154 additions and 0 deletions

31
apps/api/src/app.ts Normal file
View File

@@ -0,0 +1,31 @@
import express from 'express';
import cors from 'cors';
import helmet from 'helmet';
import { env } from './config/env.js';
import { errorMiddleware } from './middlewares/error.middleware.js';
const app = express();
// Security
app.use(helmet());
app.use(cors({
origin: env.CORS_ORIGIN,
credentials: true,
}));
// Body parsing
app.use(express.json());
app.use(express.urlencoded({ extended: true }));
// Health check
app.get('/health', (req, res) => {
res.json({ status: 'ok', timestamp: new Date().toISOString() });
});
// API Routes (to be added)
// app.use('/api/auth', authRoutes);
// Error handling
app.use(errorMiddleware);
export { app };