This commit is contained in:
@@ -743,10 +743,7 @@ img { max-width: 100%; display: block; }
|
||||
|
||||
<section class="hero" id="hero">
|
||||
<div class="hero-bg"><img src="./img/hero-bg.webp" alt="" fetchpriority="high"></div>
|
||||
<div class="container">
|
||||
<h1 style="position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0">Демонтаж трубопроводов и утилизация отходов по всей России</h1>
|
||||
<div class="hero-content" id="heroContent"></div>
|
||||
</div>
|
||||
<div class="container"><div class="hero-content" id="heroContent"></div></div>
|
||||
</section>
|
||||
|
||||
<section class="section section-alt" id="about">
|
||||
|
||||
23
server.js
23
server.js
@@ -6,6 +6,29 @@ const sharp = require('sharp');
|
||||
require('dotenv').config();
|
||||
|
||||
const app = express();
|
||||
|
||||
app.use((req, res, next) => {
|
||||
const proto = req.headers['x-forwarded-proto'];
|
||||
if (proto && proto !== 'https') {
|
||||
return res.redirect(301, 'https://' + req.headers.host + req.url);
|
||||
}
|
||||
next();
|
||||
});
|
||||
|
||||
app.use((req, res, next) => {
|
||||
const host = req.hostname;
|
||||
if (host.startsWith('www.')) {
|
||||
const target = host.replace(/^www\./, '');
|
||||
return res.redirect(301, 'https://' + target + req.originalUrl);
|
||||
}
|
||||
next();
|
||||
});
|
||||
|
||||
app.use((req, res, next) => {
|
||||
res.setHeader('Strict-Transport-Security', 'max-age=31536000; includeSubDomains; preload');
|
||||
next();
|
||||
});
|
||||
|
||||
const PORT = process.env.PORT || 3000;
|
||||
const API_KEY = process.env.HOTEL777KEY;
|
||||
if (!API_KEY) {
|
||||
|
||||
Reference in New Issue
Block a user