mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 18:44:16 +00:00
use services/fetchRemoteStreams
This commit is contained in:
parent
8403304da4
commit
468a80703c
@ -1,11 +1,11 @@
|
||||
import fetchStreamsFromAPI from "../services/fetchStreamsFromAPI"
|
||||
import fetchRemoteStreams from "@services/fetchRemoteStreams"
|
||||
|
||||
export default {
|
||||
method: "GET",
|
||||
route: "/streams",
|
||||
fn: async (req, res) => {
|
||||
if (req.query.username) {
|
||||
const stream = await fetchStreamsFromAPI(`live/${req.query.username}${req.query.profile_id ? `:${req.query.profile_id}` : ""}`)
|
||||
const stream = await fetchRemoteStreams(`live/${req.query.username}${req.query.profile_id ? `:${req.query.profile_id}` : ""}`)
|
||||
|
||||
if (!stream) {
|
||||
return res.status(404).json({
|
||||
@ -15,7 +15,7 @@ export default {
|
||||
|
||||
return res.json(stream)
|
||||
} else {
|
||||
const streams = await fetchStreamsFromAPI()
|
||||
const streams = await fetchRemoteStreams()
|
||||
|
||||
return res.json(streams)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user