first commit
This commit is contained in:
commit
57562c5ba6
23 changed files with 1979 additions and 0 deletions
43
config/environment.ts
Normal file
43
config/environment.ts
Normal file
|
@ -0,0 +1,43 @@
|
|||
import { dirname, join } from "path";
|
||||
import { fileURLToPath } from "url";
|
||||
|
||||
import type{ IEnvironment } from "../src/interfaces/environment";
|
||||
|
||||
const __dirname : string = join(dirname(fileURLToPath(import.meta.url)), "..");
|
||||
|
||||
const environment : IEnvironment = {
|
||||
development: process.env.NODE_ENV === "development" || process.argv.includes("--dev"),
|
||||
|
||||
fastify: {
|
||||
host: process.env.HOST || "0.0.0.0",
|
||||
port: parseInt(process.env.PORT || "8080"),
|
||||
},
|
||||
|
||||
discord: {
|
||||
auth: {
|
||||
token: process.env.DISCORD_TOKEN || "",
|
||||
guildId: process.env.DISCORD_GUILD_ID || "",
|
||||
},
|
||||
watchIds: [
|
||||
(() => {
|
||||
const id = process.env.DISCORD_USER_ID;
|
||||
if (id && /^\d+$/.test(id)) {
|
||||
return BigInt(id);
|
||||
}
|
||||
return BigInt(0);
|
||||
})()
|
||||
],
|
||||
},
|
||||
|
||||
paths: {
|
||||
src: __dirname,
|
||||
www: {
|
||||
root: join(__dirname, "src", "www"),
|
||||
views: join(__dirname, "src", "www", "views"),
|
||||
public: join(__dirname, "src", "www", "public")
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export default environment;
|
||||
export { environment };
|
Loading…
Add table
Add a link
Reference in a new issue