mirror of
https://github.com/TeamPiped/Piped-Backend.git
synced 2024-12-13 05:40:30 +05:30
Merge pull request #571 from TeamPiped/channel-handles
Add support for channel handles
This commit is contained in:
commit
a753c15dcc
@ -170,6 +170,14 @@ public class ServerLauncher extends MultithreadedHttpServerLauncher {
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
return getErrorResponse(e, request.getPath());
|
return getErrorResponse(e, request.getPath());
|
||||||
}
|
}
|
||||||
|
})).map(GET, "/@/:handle", AsyncServlet.ofBlocking(executor, request -> {
|
||||||
|
try {
|
||||||
|
return getJsonResponse(
|
||||||
|
ChannelHandlers.channelResponse("@" + request.getPathParameter("handle")),
|
||||||
|
"public, max-age=600", true);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return getErrorResponse(e, request.getPath());
|
||||||
|
}
|
||||||
})).map(GET, "/nextpage/channel/:channelId", AsyncServlet.ofBlocking(executor, request -> {
|
})).map(GET, "/nextpage/channel/:channelId", AsyncServlet.ofBlocking(executor, request -> {
|
||||||
try {
|
try {
|
||||||
return getJsonResponse(ChannelHandlers.channelPageResponse(request.getPathParameter("channelId"),
|
return getJsonResponse(ChannelHandlers.channelPageResponse(request.getPathParameter("channelId"),
|
||||||
@ -526,6 +534,7 @@ public class ServerLauncher extends MultithreadedHttpServerLauncher {
|
|||||||
return Config.create()
|
return Config.create()
|
||||||
.with("http.listenAddresses",
|
.with("http.listenAddresses",
|
||||||
Config.ofValue(ofInetSocketAddress(), new InetSocketAddress(Constants.PORT)))
|
Config.ofValue(ofInetSocketAddress(), new InetSocketAddress(Constants.PORT)))
|
||||||
|
.with("bytebuf.useWatchdog", String.valueOf(true))
|
||||||
.with("workers", Constants.HTTP_WORKERS);
|
.with("workers", Constants.HTTP_WORKERS);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -16,6 +16,7 @@ curl "${CURLOPTS[@]}" $HOST/trending?region=US || exit 1
|
|||||||
curl "${CURLOPTS[@]}" $HOST/channel/UCsXVk37bltHxD1rDPwtNM8Q || exit 1
|
curl "${CURLOPTS[@]}" $HOST/channel/UCsXVk37bltHxD1rDPwtNM8Q || exit 1
|
||||||
curl "${CURLOPTS[@]}" $HOST/c/inanutshell || exit 1
|
curl "${CURLOPTS[@]}" $HOST/c/inanutshell || exit 1
|
||||||
curl "${CURLOPTS[@]}" $HOST/user/Kurzgesagt || exit 1
|
curl "${CURLOPTS[@]}" $HOST/user/Kurzgesagt || exit 1
|
||||||
|
curl "${CURLOPTS[@]}" $HOST/@/kurzgesagt || exit 1
|
||||||
|
|
||||||
# Channel Nextpage
|
# Channel Nextpage
|
||||||
CHANNEL_NEXTPAGE=$(curl -s -o - -f $HOST/channel/UCsXVk37bltHxD1rDPwtNM8Q | jq -r .nextpage)
|
CHANNEL_NEXTPAGE=$(curl -s -o - -f $HOST/channel/UCsXVk37bltHxD1rDPwtNM8Q | jq -r .nextpage)
|
||||||
|
Loading…
Reference in New Issue
Block a user