Package, Server, Routes

Adding the base of the server program
This commit is contained in:
2026-06-14 19:14:35 +02:00
parent 35372b060a
commit 15fde72f08
6 changed files with 1604 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
import {Router} from "express";
// ----------------------------------------
// Router config
// ----------------------------------------
const router = Router();
// ----------------------------------------
// Routes
// ----------------------------------------
router.get("/", (req, res) => {
res.json("Server Alive !")
})
// ----------------------------------------
// Export router
// ----------------------------------------
module.exports = router;

23
src/server.ts Normal file
View File

@@ -0,0 +1,23 @@
import express from "express";
// ----------------------------------------
// Backend configuration
// ----------------------------------------
const PORT = 5000;
const app = express();
// ----------------------------------------
// Middleware configuration
// ----------------------------------------
app.use(express.json());
app.use(express.urlencoded( {extended: false }));
// ----------------------------------------
// Routes import
// ----------------------------------------
app.use("/status", require("./routes/status.routes"));
// ----------------------------------------
// Starting Server
// ----------------------------------------
app.listen(PORT, () => console.log("Server started at port : " + PORT));