Commit c54d11d9 authored by Sylvain Coulange's avatar Sylvain Coulange
Browse files

retour case départ

parent 1a24535f
......@@ -5,25 +5,19 @@ const fs = require('fs');
const requestIp = require('request-ip');
const compression = require('compression');
const helmet = require('helmet');
const http = require('http');
// PORT & HOSTNAME
const server = http.createServer((req, res) => {
res.statusCode = 200;
res.setHeader('Content-Type', 'text/plain');
res.end('Démarrage !\n');
});
// PORT
const port = 8080;
app.listen(port, () => console.log(`Listening on port ${port}...`));
const port = 6000;
const hostname = '0.0.0.0';
server.listen(port, hostname, () => {
console.log(`Server running at http://${hostname}:${port}/`);
});
// server.listen(port, hostname, () => {
// console.log(`Server running at http://${hostname}:${port}/`);
// });
app.use(express.json());
// app.use(express.static('public'));
app.use('/static', express.static(__dirname + '/public'));
app.use(express.static('public'));
//app.use('/static', express.static(__dirname + '/public'));
app.use(compression()); // Compress all routes
app.use(helmet()); // Protection de base pour l'appli
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment