split files + restrict public context
This commit is contained in:
@@ -2,7 +2,12 @@ import fs from 'fs';
|
||||
import express from 'express';
|
||||
import axios from 'axios';
|
||||
import https from 'https';
|
||||
import path from 'path';
|
||||
import { HttpsProxyAgent } from 'https-proxy-agent'; // <-- AJOUT
|
||||
import { fileURLToPath } from 'url';
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = path.dirname(__filename);
|
||||
|
||||
// ==========================================
|
||||
// Lecture du fichier config.ini (inchangé)
|
||||
@@ -81,10 +86,26 @@ jiraClient.interceptors.response.use(
|
||||
// ==========================================
|
||||
// Serveur Express
|
||||
// ==========================================
|
||||
// const app = express();
|
||||
//app.use(express.json({ limit: '10mb' }));
|
||||
|
||||
//app.use(express.static('.')); // Sert index.html à /
|
||||
|
||||
|
||||
const app = express();
|
||||
|
||||
// 1. Middlewares
|
||||
app.use(express.json({ limit: '10mb' }));
|
||||
|
||||
app.use(express.static('.')); // Sert index.html à /
|
||||
// 2. Fichiers statiques (CSS, JS client, Images)
|
||||
// On ne sert QUE le contenu du dossier public
|
||||
app.use(express.static(path.join(__dirname, 'public')));
|
||||
|
||||
// 3. Routes HTML
|
||||
app.get('/', (req, res) => {
|
||||
// On va chercher l'index dans /views/
|
||||
res.sendFile(path.join(__dirname, 'index.html'));
|
||||
});
|
||||
|
||||
|
||||
// Endpoint d'extraction
|
||||
|
||||
Reference in New Issue
Block a user