mirror of
https://github.com/imputnet/cobalt.git
synced 2025-07-21 12:48:28 +00:00
resetting branch and readding this again
This commit is contained in:
parent
2a7a0df8a1
commit
aa56653483
3
.gitignore
vendored
3
.gitignore
vendored
@ -14,3 +14,6 @@ docker-compose.yml
|
||||
|
||||
# cookie file
|
||||
cookies.json
|
||||
|
||||
# pnpm-lock
|
||||
pnpm-lock.yaml
|
@ -1,6 +1,7 @@
|
||||
import cors from "cors";
|
||||
import rateLimit from "express-rate-limit";
|
||||
import { randomBytes } from "crypto";
|
||||
import expressPrometheusMiddleware from "express-prometheus-middleware";
|
||||
|
||||
const ipSalt = randomBytes(64).toString('hex');
|
||||
|
||||
@ -59,6 +60,12 @@ export function runAPI(express, app, gitCommit, gitBranch, __dirname) {
|
||||
app.use('/api/stream', apiLimiterStream);
|
||||
app.use('/api/onDemand', apiLimiter);
|
||||
|
||||
app.use(expressPrometheusMiddleware({
|
||||
metricsApp: app,
|
||||
collectGCMetrics: true,
|
||||
|
||||
}))
|
||||
|
||||
app.use((req, res, next) => {
|
||||
try { decodeURIComponent(req.path) } catch (e) { return res.redirect('/') }
|
||||
next();
|
||||
|
@ -26,12 +26,14 @@
|
||||
"dotenv": "^16.0.1",
|
||||
"esbuild": "^0.14.51",
|
||||
"express": "^4.18.1",
|
||||
"express-prometheus-middleware": "^1.2.0",
|
||||
"express-rate-limit": "^6.3.0",
|
||||
"ffmpeg-static": "^5.1.0",
|
||||
"hls-parser": "^0.10.7",
|
||||
"ipaddr.js": "2.1.0",
|
||||
"nanoid": "^4.0.2",
|
||||
"node-cache": "^5.1.2",
|
||||
"prom-client": "^15.1.2",
|
||||
"psl": "1.9.0",
|
||||
"set-cookie-parser": "2.6.0",
|
||||
"undici": "^6.7.0",
|
||||
|
Loading…
Reference in New Issue
Block a user