mirror of
https://gitlab.com/qwerinope/qweribot.git
synced 2026-02-04 11:06:59 +01:00
root web now redirects to stream
This commit is contained in:
@@ -3,6 +3,8 @@ import chatWidget from "web/chatWidget/www/index.html";
|
|||||||
import { getBadges, getExternalEmotes } from "web/chatWidget/widgetServerFunctions";
|
import { getBadges, getExternalEmotes } from "web/chatWidget/widgetServerFunctions";
|
||||||
import alerts from "web/alerts/www/index.html";
|
import alerts from "web/alerts/www/index.html";
|
||||||
import type { serverInstruction, serverNotificationEvent } from "web/serverTypes";
|
import type { serverInstruction, serverNotificationEvent } from "web/serverTypes";
|
||||||
|
import User from "user";
|
||||||
|
import { streamerId } from "main";
|
||||||
|
|
||||||
const port = Number(process.env.WEB_PORT);
|
const port = Number(process.env.WEB_PORT);
|
||||||
if (isNaN(port)) { logger.enverr("WEB_PORT"); process.exit(1); };
|
if (isNaN(port)) { logger.enverr("WEB_PORT"); process.exit(1); };
|
||||||
@@ -24,6 +26,10 @@ export default Bun.serve({
|
|||||||
const file = Bun.file(`${import.meta.dir}/alerts/www/public/${target}`);
|
const file = Bun.file(`${import.meta.dir}/alerts/www/public/${target}`);
|
||||||
if (!await file.exists()) return new Response(`${target} not found`, { status: 404 });
|
if (!await file.exists()) return new Response(`${target} not found`, { status: 404 });
|
||||||
return new Response(file);
|
return new Response(file);
|
||||||
|
},
|
||||||
|
"/": async _req => {
|
||||||
|
const streamer = await User.initUserId(streamerId);
|
||||||
|
return Response.redirect(`https://twitch.tv/${streamer?.username}`);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
websocket: {
|
websocket: {
|
||||||
|
|||||||
Reference in New Issue
Block a user