Spaces:
Sleeping
Sleeping
Download src/index.ts from eneeyan/iqmath-backend-api: direct link, hf CLI and curl.
- Browser
- Download file 899 Bytes
-
https://huggingface.co/spaces/eneeyan/iqmath-backend-api/resolve/main/src/index.ts
- Command line
-
hf download hf://spaces/eneeyan/iqmath-backend-api/src/index.ts
-
curl -L -o index.ts https://huggingface.co/spaces/eneeyan/iqmath-backend-api/resolve/main/src/index.ts
899 Bytes
| import express from "express"; | |
| import cors from "cors"; | |
| import dotenv from "dotenv"; | |
| import authRoutes from "./routes/auth"; | |
| import productRoutes from "./routes/products"; | |
| import dashboardRoutes from "./routes/dashboard"; | |
| import userRoutes from "./routes/users"; | |
| dotenv.config(); | |
| const app = express(); | |
| app.use(cors()); | |
| app.use(express.json()); | |
| app.get("/", (_req, res) => { | |
| res.json({ ok: true, message: "IQMath backend is running" }); | |
| }); | |
| app.get("/health", (_req, res) => { | |
| res.json({ ok: true, service: "iqmath-backend" }); | |
| }); | |
| app.use("/api/auth", authRoutes); | |
| app.use("/api/products", productRoutes); | |
| app.use("/api/dashboard", dashboardRoutes); | |
| app.use("/api/users", userRoutes); | |
| const port = Number(process.env.PORT || 5000); | |
| app.listen(port, () => { | |
| // eslint-disable-next-line no-console | |
| console.log(`IQMath backend listening on ${port}`); | |
| }); | |