File size: 962 Bytes
80d4bc1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
af74e15
ed2917f
6929493
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import express, { Request } from "express";
import cors from "cors";
import 'dotenv/config'
import { setupRoutes } from "./routes";
import { PORT } from "./config";

import { loginWithSession } from "./controllers";
import { handleCreateTask, handleLoginWithSession, setupTaskSystem } from "./services";
import { fetchDataFromTable, updateDataInTable } from "./db/supabaseHelper";
import { normalizeArabicText } from "./utils";
import { handleAddTelegrafBot } from "./bots";
async function startServer() {
  const app = express();
  app.use(express.json());
  app.use(
    cors({
      origin: "*",
      methods: ["GET", "POST", "PUT", "DELETE"],
      allowedHeaders: ["Content-Type", "Authorization"],
    })
  );

  setupRoutes(app);

  // Initialize task system
  // setupTaskSystem(app);

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

startServer();


// handleAddTelegrafBot("049a92c4-7654-43f6-8e6f-7ff5cce78995")