1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-09-22 02:31:36 +02:00
server/client_test/index.html
Umimaso f10df31f5c feat: add widget endpoints
Implemented the four widget related endpoints of the api. Partial user
object being returned as part of the widget.json endpoint [1] is an
intentional choice related to privacy [2].

The widget.json endpoint will require additional changes upon completion
of other work. Member details will need to return extra key/values for
connected users to voice channels. An additional avatar_url value will
hold an unique avatar url for the user + guild, fetched via a CDN
endpoint widget-avatars.

New dependencies `canvas` and `image-size`. Canvas is used to create the
widget.png endpoint image [3]. Image-size is used to set the canvas'
size to match the widget template images.

Use regex in determining if a NO_AUTHORIZATION_ROUTES is hit or not.

[1] https://discord.com/developers/docs/resources/guild#get-guild-widget
[2] https://github.com/discord/discord-api-docs/issues/1287
[3] https://discord.com/developers/docs/resources/guild#get-guild-widget-image

Closes: #9, #110
2021-06-19 14:50:11 +01:00

49 lines
1.8 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Discord Test Client</title>
</head>
<body>
<div id="app-mount"></div>
<script>
window.__OVERLAY__ = /overlay/.test(location.pathname);
window.__BILLING_STANDALONE__ = /^\/billing/.test(location.pathname);
window.GLOBAL_ENV = {
API_ENDPOINT: "/api",
WEBAPP_ENDPOINT: "",
CDN_HOST: "//localhost:3003",
ASSET_ENDPOINT: "",
MEDIA_PROXY_ENDPOINT: "https://media.discordapp.net",
WIDGET_ENDPOINT: "//localhost:3001/widget",
INVITE_HOST: "discord.gg",
GUILD_TEMPLATE_HOST: "discord.new",
GIFT_CODE_HOST: "discord.gift",
RELEASE_CHANNEL: "stable",
MARKETING_ENDPOINT: "//discord.com",
BRAINTREE_KEY: "production_5st77rrc_49pp2rp4phym7387",
STRIPE_KEY: "pk_live_CUQtlpQUF0vufWpnpUmQvcdi",
NETWORKING_ENDPOINT: "//router.discordapp.net",
RTC_LATENCY_ENDPOINT: "//latency.discord.media/rtc",
PROJECT_ENV: "production",
REMOTE_AUTH_ENDPOINT: "//remote-auth-gateway.discord.gg",
SENTRY_TAGS: { buildId: "75e36d9", buildType: "normal" },
MIGRATION_SOURCE_ORIGIN: "https://discordapp.com",
MIGRATION_DESTINATION_ORIGIN: "https://discord.com",
HTML_TIMESTAMP: Date.now(),
ALGOLIA_KEY: "aca0d7082e4e63af5ba5917d5e96bed0"
};
localStorage.removeItem("gatewayURL");
localStorage.setItem(
"DeveloperOptionsStore",
`{"trace":false,"canary":false,"logGatewayEvents":true,"logOverlayEvents":false,"logAnalyticsEvents":false,"sourceMapsEnabled":false,"axeEnabled":false}`
);
</script>
<script src="/assets/2b51ccc483c24624b4e4.js"></script>
<script src="/assets/f70adb19750694f9b703.js"></script>
<script src="/assets/d850ccc09f143ad7daa1.js"></script>
<script src="/assets/55bf39c3af597194d853.js"></script>
</body>
</html>