move common dir
All checks were successful
Deploy App / docker (ubuntu-latest) (push) Successful in 1m9s

This commit is contained in:
Lee
2024-04-20 02:35:52 +01:00
parent 6356be7ac3
commit 18a782243e
36 changed files with 39 additions and 38 deletions

17
src/app/common/server.ts Normal file
View File

@ -0,0 +1,17 @@
import { getServer, ServerPlatform } from "mcutils-library";
/**
* Checks if the server is valid.
*
* @param platform the server's platform
* @param query the hostname for the server
* @returns true if valid, false otherwise
*/
export async function isValidServer(platform: ServerPlatform, query: string): Promise<boolean> {
try {
await getServer(platform, query);
return true;
} catch {
return false;
}
}