mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-10 02:54:15 +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 {
|
export default {
|
||||||
method: "GET",
|
method: "GET",
|
||||||
route: "/streams",
|
route: "/streams",
|
||||||
fn: async (req, res) => {
|
fn: async (req, res) => {
|
||||||
if (req.query.username) {
|
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) {
|
if (!stream) {
|
||||||
return res.status(404).json({
|
return res.status(404).json({
|
||||||
@ -15,7 +15,7 @@ export default {
|
|||||||
|
|
||||||
return res.json(stream)
|
return res.json(stream)
|
||||||
} else {
|
} else {
|
||||||
const streams = await fetchStreamsFromAPI()
|
const streams = await fetchRemoteStreams()
|
||||||
|
|
||||||
return res.json(streams)
|
return res.json(streams)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user