File size: 631 Bytes
5cbc445 |
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 |
import express from "express";
import http from "http";
import dotenv from "dotenv";
import { connectDB } from "./db.js";
import authRoutes from "./routes/auth.js";
import uploadRoutes from "./routes/upload.js";
import adminRoutes from "./routes/admin.js";
import { initAdminWS } from "./ws/adminWs.js";
dotenv.config();
await connectDB();
const app = express();
app.use(express.json());
app.use("/auth", authRoutes);
app.use("/upload", uploadRoutes);
app.use("/admin", adminRoutes);
const server = http.createServer(app);
initAdminWS(server);
server.listen(3000, () =>
console.log("🚀 BACKEND FINAL RUNNING ON :3000")
);
|