misc_pterodactyl-panel/resources/scripts/api/server/getWebsocketToken.ts

10 lines
297 B
TypeScript
Raw Normal View History

import http from '@/api/http';
export default (server: string): Promise<string> => {
return new Promise((resolve, reject) => {
http.get(`/api/client/servers/${server}/websocket`)
.then(response => resolve(response.data.data.socket))
.catch(reject);
});
};