You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
602 B
21 lines
602 B
import dotenv from "dotenv";
|
|
import {GameServer} from "./GameServer.js";
|
|
|
|
async function main(): Promise<void> {
|
|
const {parsed, error} = dotenv.config()
|
|
if (error || !parsed) {
|
|
throw error ?? Error("No parsed data.")
|
|
}
|
|
const clientSecret = parsed["DISCORD_CLIENT_SECRET"]
|
|
const appId = parsed["DISCORD_APP_ID"]
|
|
const port = parseInt(parsed["HTTP_PORT"] ?? "5244")
|
|
const server = new GameServer({
|
|
appId, port, secret: clientSecret
|
|
})
|
|
return await server.initialize()
|
|
}
|
|
|
|
main().catch((err) => {
|
|
console.log("Main crashed!")
|
|
console.log(err)
|
|
})
|
|
|