initial packages and template

This commit is contained in:
2023-02-28 11:10:30 +01:00
parent 693ac39905
commit 5f327c0272
10 changed files with 3743 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
import { Router } from "express";
const router = Router();
//timeout middleware ?
router.get("/*", (req, res, next) => {
next();
});
router.get("/client/:clientId/", (req, res, next) => {
res.send("get information about client number " + req.params.clientId);
});
router.get("/server/:serverId/", (req, res, next) => {
res.send("get information about server number " + req.params.serverId);
});
router.get("/weapon/:weaponId/", (req, res, next) => {
res.send("get information about weapon " + req.params.weaponId);
});
export default router;
+17
View File
@@ -0,0 +1,17 @@
import express from "express";
import client from "./client";
import server from "./server";
const app = express();
const port = 3000;
app.get("/", (req, res) => {
res.send("Hello World!");
});
app.use("/register", server);
app.use("/api", client);
app.listen(port, () => {
console.log(`Example app listening on port ${port}`);
});
+10
View File
@@ -0,0 +1,10 @@
import { Router } from "express";
const router = Router();
//auth middleware
router.post("/*", (req, res, next) => {
next();
});
router.post("/*", (req, res, next) => {
next();
});
export default router;