Download src/server.js from TwanAPI/trsstapi: direct link, hf CLI and curl.
- Browser
- Download file 631 Bytes
-
https://huggingface.co/spaces/TwanAPI/trsstapi/resolve/de2e0fefcfcbbc7b9f08d2b8c25aeab664668cd4/src/server.js
- Command line
-
hf download hf://spaces/TwanAPI/trsstapi@de2e0fefcfcbbc7b9f08d2b8c25aeab664668cd4/src/server.js
-
curl -L -o server.js https://huggingface.co/spaces/TwanAPI/trsstapi/resolve/de2e0fefcfcbbc7b9f08d2b8c25aeab664668cd4/src/server.js
631 Bytes
| 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") | |
| ); | |