--- /dev/null
+// =========================================================
+// PRICE SERVICE - Serveur standalone
+// =========================================================
+// Ce fichier encapsule le module price
+// en microservice Express indépendant sur port 3001.
+//
+// USAGE : node modules/price/server.js (depuis Wallette/server/)
+// PORT : process.env.PRICE_PORT || 3001
+// =========================================================
+
+import cors from 'cors';
+import dotenv from 'dotenv';
+import express from 'express';
+import path from 'path';
+import { fileURLToPath } from 'url';
+
+// Charger .env depuis Wallette/server/.env
+const __filename = fileURLToPath(import.meta.url);
+const __dirname = path.dirname(__filename);
+dotenv.config({ path: path.resolve(__dirname, '../../.env') });
+
+// IMPORTANT : dotenv doit être chargé AVANT l'import du router
+// car db.js lit process.env au moment de l'import
+const { default: priceApiRouter } = await import('./routes/api.router.js');
+
+const PORT = process.env.PRICE_PORT || 3001;
+
+const app = express();
+app.use(cors());
+app.use(express.json());
+app.use(express.static(path.join(__dirname, 'public')));
+
+// ─── Health check (requis par le gateway) ────────────────
+app.get('/health', (req, res) => {
+ res.json({ ok: true, service: 'price-service', port: PORT });
+});
+
+// ─── Routes API price ─────────────────────────────────────
+// Le router expose /price/current, /price/history...
+// On le monte sur /api pour que le gateway route /api/price/* correctement
+app.use('/api', priceApiRouter);
+
+// ─── 404 ─────────────────────────────────────────────────
+app.use((req, res) => {
+ res.status(404).json({ ok: false, error: { code: 'NOT_FOUND', message: 'Route non trouvée' } });
+});
+
+// ─── Démarrage ────────────────────────────────────────────
+app.listen(PORT, () => {
+ console.log(`
+ ╔══════════════════════════════════════════╗
+ ║ PRICE SERVICE ║
+ ║ HTTP : http://localhost:${PORT} ║
+ ║ → /health = OK ║
+ ║ → /api/price/current?pair= = prix ║
+ ║ → /api/price/history?pair= = historique ║
+ ╚══════════════════════════════════════════╝`);
+});