Skip to content

Commit

Permalink
fix: connectTimoout
Browse files Browse the repository at this point in the history
  • Loading branch information
btwlouis committed Dec 29, 2024
1 parent cdd05e5 commit ffcd2be
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 55 deletions.
1 change: 1 addition & 0 deletions backend/src/database/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ export default mysql.createConnection({
user: process.env.MYSQL_USER,
password: process.env.MYSQL_PASSWORD,
database: process.env.MYSQL_DATABASE,
connectTimeout: 60 * 60 * 1000,
});
55 changes: 0 additions & 55 deletions backend/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,60 +3,9 @@ import cors, { CorsOptions } from "cors";

var cron = require("node-cron");

// import { fetchServers, GameName } from "../services/fivem.service";

// import * as Server from "../services/server.service";
// import * as ServerHistory from "../services/server.history.service";

import { config } from "dotenv";
config();

// app.get("/servers", (req: any, res: any) => {
// Server.getAll()
// .then((servers) => {
// res.send(servers);
// })
// .catch((error) => {
// console.log("Error fetching servers", error);
// res.status(500).send("Error fetching servers");
// });
// });

// app.get("/server/:id", (req: any, res: any) => {
// Server.get(req.params.id)
// .then((server) => {
// res.send(server);
// })
// .catch((error) => {
// console.log("Error fetching server", error);
// res.status(500).send("Error fetching server");
// });
// });

// app.get("/server/:id/history/:period", (req: any, res: any) => {
// ServerHistory.get(req.params.id, req.params.period)
// .then((history) => {
// res.send(history);
// })
// .catch((error) => {
// console.log("Error fetching server history", error);
// res.status(500).send("Error fetching server history");
// });
// });

//app.get("/stats", (req: any, res: any) => {
// Server.getStats()
// .then((stats) => {
// res.send(stats);
// })
// .catch((error) => {
// console.log("Error fetching stats", error);
// res.status(500).send("Error fetching stats");
// });
//});

//getServers();

import { getServers } from "./services/fivem.service";
import Routes from "./routes/index";

Expand All @@ -71,14 +20,10 @@ export default class Server {
origin: process.env.FRONTEND_URL,
};

console.log("frontend", process.env.FRONTEND_URL);


app.use(cors(corsOptions));
app.use(express.json());
app.use(express.urlencoded({ extended: true }));

console.log("test");
this.startCronJob();
}

Expand Down

0 comments on commit ffcd2be

Please sign in to comment.