File size: 425 Bytes
e1dafe2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import { createApp } from "./app.js";
import { DiscordWebhook } from "./discord-webhook.js";

const webhookUrl = process.env.WEBHOOK_URL;
if (!webhookUrl) {
    console.error("WEBHOOK_URL environment variable is not set.");
    process.exit(1);
}

const PORT = process.env.PORT ?? 80;
const app = createApp(new DiscordWebhook(webhookUrl));

app.listen(PORT, () => {
    console.log(`Server is listening on port ${PORT}`);
});