This commit is contained in:
zimplexing
2025-06-27 16:16:14 +08:00
commit 7e6095d2bb
111 changed files with 20915 additions and 0 deletions

28
backend/src/index.ts Normal file
View File

@@ -0,0 +1,28 @@
import express, { Express, Request, Response } from "express";
import cors from "cors";
import dotenv from "dotenv";
dotenv.config();
const app: Express = express();
const port = process.env.PORT || 3001;
// Middlewares
app.use(cors());
app.use(express.json());
// Health check route
app.get("/", (req: Request, res: Response) => {
res.send("MyTV Backend Service is running!");
});
import apiRouter from "./routes";
// API routes
app.use("/api", apiRouter);
app.listen(port, () => {
console.log(`[server]: Server is running at http://localhost:${port}`);
});
export default app;