mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 10:34:17 +00:00
23 lines
638 B
JavaScript
Executable File
23 lines
638 B
JavaScript
Executable File
import fetchRemoteStreams from "@services/fetchRemoteStreams"
|
|
|
|
export default {
|
|
method: "GET",
|
|
route: "/streams",
|
|
fn: async (req, res) => {
|
|
if (req.query.username) {
|
|
const stream = await fetchRemoteStreams(`${req.query.username}${req.query.profile_id ? `__${req.query.profile_id}` : ""}`)
|
|
|
|
if (!stream) {
|
|
return res.status(404).json({
|
|
error: "Stream not found"
|
|
})
|
|
}
|
|
|
|
return res.json(stream)
|
|
} else {
|
|
const streams = await fetchRemoteStreams()
|
|
|
|
return res.json(streams)
|
|
}
|
|
}
|
|
} |