Fix #14 make mastodon instance configurable

This commit is contained in:
2023-04-04 12:45:27 +02:00
parent 5dd20cd6a0
commit a3751c985b
3 changed files with 8 additions and 6 deletions

View File

@ -1,4 +1,4 @@
import { HASHTAG_FILTER, URL_FILTER, YOUTUBE_API_KEY } from '$env/static/private';
import { HASHTAG_FILTER, MASTODON_INSTANCE, URL_FILTER, YOUTUBE_API_KEY } from '$env/static/private';
import type { Post, Tag, TimelineEvent } from '$lib/mastodon/response';
import { savePost } from '$lib/server/db';
import { WebSocket } from "ws";
@ -55,7 +55,7 @@ export class TimelineReader {
}
private constructor() {
const socket = new WebSocket("wss://metalhead.club/api/v1/streaming")
const socket = new WebSocket(`wss://${MASTODON_INSTANCE}/api/v1/streaming`);
socket.onopen = (_event) => {
socket.send('{ "type": "subscribe", "stream": "public:local"}');
};