Initial: FOLX live landing page
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
const path = require('path');
|
||||
const express = require('express');
|
||||
|
||||
const app = express();
|
||||
const PORT = process.env.PORT || 3000;
|
||||
|
||||
const STREAM_URL = process.env.HLS_URL || 'https://folxplay.b-cdn.net/live/stream1_master.m3u8';
|
||||
|
||||
app.set('view engine', 'ejs');
|
||||
app.set('views', path.join(__dirname, '..', 'views'));
|
||||
|
||||
app.use(express.static(path.join(__dirname, '..', 'public'), {
|
||||
maxAge: '1h',
|
||||
etag: true,
|
||||
}));
|
||||
|
||||
app.get('/', (_req, res) => {
|
||||
res.render('index', { hlsUrl: STREAM_URL });
|
||||
});
|
||||
|
||||
app.get('/api/health', (_req, res) => {
|
||||
res.json({ ok: true, hls: STREAM_URL, ts: Date.now() });
|
||||
});
|
||||
|
||||
app.listen(PORT, () => {
|
||||
console.log(`[folx-live] listening on :${PORT}`);
|
||||
console.log(`[folx-live] HLS source: ${STREAM_URL}`);
|
||||
});
|
||||
Reference in New Issue
Block a user