minor clean up
This commit is contained in:
parent
450d01753d
commit
b8330fc855
2 changed files with 10 additions and 10 deletions
|
@ -21,15 +21,15 @@ import { changelogHistory } from "./modules/pageRender/onDemand.js";
|
||||||
import { sha256 } from "./modules/sub/crypto.js";
|
import { sha256 } from "./modules/sub/crypto.js";
|
||||||
import findRendered from "./modules/pageRender/findRendered.js";
|
import findRendered from "./modules/pageRender/findRendered.js";
|
||||||
|
|
||||||
const commitHash = shortCommit();
|
|
||||||
const branch = getCurrentBranch();
|
|
||||||
const app = express();
|
|
||||||
|
|
||||||
const corsConfig = process.env.cors === '0' ? { origin: process.env.selfURL, optionsSuccessStatus: 200 } : {};
|
|
||||||
|
|
||||||
app.disable('x-powered-by');
|
|
||||||
|
|
||||||
if (process.env.selfURL && process.env.streamSalt && process.env.port) {
|
if (process.env.selfURL && process.env.streamSalt && process.env.port) {
|
||||||
|
const commitHash = shortCommit();
|
||||||
|
const branch = getCurrentBranch();
|
||||||
|
const app = express();
|
||||||
|
|
||||||
|
app.disable('x-powered-by');
|
||||||
|
|
||||||
|
const corsConfig = process.env.cors === '0' ? { origin: process.env.selfURL, optionsSuccessStatus: 200 } : {};
|
||||||
|
|
||||||
const apiLimiter = rateLimit({
|
const apiLimiter = rateLimit({
|
||||||
windowMs: 60000,
|
windowMs: 60000,
|
||||||
max: 25,
|
max: 25,
|
||||||
|
@ -64,7 +64,7 @@ if (process.env.selfURL && process.env.streamSalt && process.env.port) {
|
||||||
app.use('/', express.static('./src/front'));
|
app.use('/', express.static('./src/front'));
|
||||||
|
|
||||||
app.use((req, res, next) => {
|
app.use((req, res, next) => {
|
||||||
try { decodeURIComponent(req.path) } catch (e) { return res.redirect(process.env.selfURL) }
|
try { decodeURIComponent(req.path) } catch (e) { return res.redirect('/') }
|
||||||
next();
|
next();
|
||||||
});
|
});
|
||||||
app.use((req, res, next) => {
|
app.use((req, res, next) => {
|
||||||
|
|
|
@ -51,7 +51,7 @@ export default function(obj) {
|
||||||
<meta property="og:url" content="${process.env.selfURL}" />
|
<meta property="og:url" content="${process.env.selfURL}" />
|
||||||
<meta property="og:title" content="${appName}" />
|
<meta property="og:title" content="${appName}" />
|
||||||
<meta property="og:description" content="${t('EmbedBriefDescription')}" />
|
<meta property="og:description" content="${t('EmbedBriefDescription')}" />
|
||||||
<meta property="og:image" content="${process.env.selfURL}icons/generic.png" />
|
<meta property="og:image" content="icons/generic.png" />
|
||||||
<meta name="title" content="${appName}" />
|
<meta name="title" content="${appName}" />
|
||||||
<meta name="description" content="${t('AboutSummary')}" />
|
<meta name="description" content="${t('AboutSummary')}" />
|
||||||
<meta name="theme-color" content="#000000" />
|
<meta name="theme-color" content="#000000" />
|
||||||
|
|
Loading…
Reference in a new issue