use .env
This commit is contained in:
7
app.ts
7
app.ts
@@ -3,18 +3,13 @@ import Chat from "./common/chat";
|
|||||||
import { config as dotenv } from "dotenv";
|
import { config as dotenv } from "dotenv";
|
||||||
import { Controller } from "./core";
|
import { Controller } from "./core";
|
||||||
import { ClientController } from "./controllers";
|
import { ClientController } from "./controllers";
|
||||||
import { ENVIRONMENT } from "./constants";
|
|
||||||
import { getSettings } from "./common";
|
|
||||||
|
|
||||||
dotenv();
|
dotenv();
|
||||||
|
|
||||||
const environment: string = ENVIRONMENT;
|
|
||||||
const appSettings: any = getSettings(environment);
|
|
||||||
|
|
||||||
const client: Client = new Client();
|
const client: Client = new Client();
|
||||||
const chat: Chat = new Chat(client);
|
const chat: Chat = new Chat(client);
|
||||||
|
|
||||||
const controllers = new Controller(new ClientController(client));
|
const controllers = new Controller(new ClientController(client));
|
||||||
|
|
||||||
controllers.register();
|
controllers.register();
|
||||||
chat.register(appSettings?.token || process.env.DEV_TOKEN || "");
|
chat.register(process.env.DEV_TOKEN || "");
|
||||||
|
|||||||
Reference in New Issue
Block a user