randydev commited on
Commit
2daf3bb
·
verified ·
1 Parent(s): aa680e5

Update index.js

Browse files
Files changed (1) hide show
  1. index.js +3 -22
index.js CHANGED
@@ -1,28 +1,9 @@
1
  const express = require('express')
2
  const app = express()
3
- const port = 7860
4
  const axios = require('axios')
5
- var Database = require('./database.js');
6
-
7
 
8
- const startup = async () => {
9
- try {
10
- const dbClient = new Database("AkenoXJs", "FastJsAPI");
11
- console.log("Starting application...");
12
- await dbClient.connect();
13
- console.log("MongoDB connected successfully.");
14
- } catch (error) {
15
- console.error("Error during startup:", error.message);
16
- process.exit(1);
17
- }
18
- };
19
-
20
- const startServer = async () => {
21
- await startup();
22
- app.listen(port, () => {
23
- console.log(`Server running on http://localhost:${port}`);
24
- });
25
- };
26
 
27
  app.get('/', (req, res) => {
28
  res.redirect('https://t.me/RendyProjects');
@@ -122,4 +103,4 @@ app.get('/api/gpt-old', async (req, res) => {
122
  });
123
 
124
 
125
- startServer();
 
1
  const express = require('express')
2
  const app = express()
 
3
  const axios = require('axios')
 
 
4
 
5
+ var startServer = require('./lifestyle.js')
6
+ var Database = require('./database.js');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
 
8
  app.get('/', (req, res) => {
9
  res.redirect('https://t.me/RendyProjects');
 
103
  });
104
 
105
 
106
+ await startServer(app);