Skip to content
This repository was archived by the owner on Oct 13, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/node_modules
.env
.babelrc
.babelrc
/uploads
94 changes: 0 additions & 94 deletions controllers/weatherController.js

This file was deleted.

19 changes: 0 additions & 19 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,13 @@ import morgan from "morgan";
import { connectMongoose } from "./utils/index.js";
import { errorHandler, routeNotFound } from "./middlewares/errorMiddleware.js";
import routes from "./routes/index.js";
import Scheduler from "./utils/scheduler.js";
import DevScheduler from "./utils/devScheduler.js";
import path from "path";
import { fileURLToPath } from "url";
import fs from "fs";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

// Create uploads directory if it doesn't exist
const uploadsDir = path.join(__dirname, "uploads");
if (!fs.existsSync(uploadsDir)) {
fs.mkdirSync(uploadsDir, { recursive: true });
Expand All @@ -29,22 +26,6 @@ const PORT = process.env.PORT || 5000;
const app = express();
app.use(cookieParser());

if (process.env.NODE_ENV === "production") {
Scheduler.initScheduledJobs();
console.log("Scheduled jobs initialized");
}

if (process.env.NODE_ENV === "development") {
app.post("/api/dev/trigger-weather-update", async (req, res) => {
try {
await DevScheduler.runWeatherUpdate();
res.json({ message: "Weather update triggered successfully" });
} catch (error) {
res.status(500).json({ error: error.message });
}
});
}

app.use(
cors({
origin: ["http://localhost:3000", "http://localhost:3001"],
Expand Down
Loading
Loading