summaryrefslogtreecommitdiffstats
path: root/backend/index.ts
diff options
context:
space:
mode:
authorMaks Jopek <maksymilian.jopek@prym-soft.pl>2021-05-26 18:50:18 +0200
committerMaks Jopek <maksymilian.jopek@prym-soft.pl>2021-05-26 18:50:18 +0200
commit1afb236c2d6828883e139652dd8c89d8949b8039 (patch)
tree905386f1ee4210937682d62d7f75bdc771184c80 /backend/index.ts
parentaa13f322e2d59fdc3c50371572c0cad443b798ec (diff)
downloadIRC-1afb236c2d6828883e139652dd8c89d8949b8039.tar.gz
IRC-1afb236c2d6828883e139652dd8c89d8949b8039.tar.zst
IRC-1afb236c2d6828883e139652dd8c89d8949b8039.zip
Version v1.0.2
Diffstat (limited to 'backend/index.ts')
-rw-r--r--backend/index.ts10
1 files changed, 1 insertions, 9 deletions
diff --git a/backend/index.ts b/backend/index.ts
index 851b84e..b57cb4d 100644
--- a/backend/index.ts
+++ b/backend/index.ts
@@ -1,18 +1,15 @@
import express from "express";
-// import cors from "cors";
const app = express();
const PORT = 8001;
app.use(express.json());
-// app.use(cors());
app.use("/", express.static("../dist"));
const longpoll = require("express-longpoll")(app);
-longpoll.create("/poll"/* , cors() */);
+longpoll.create("/poll");
app.post("/send", (req, res) => {
- // console.log(req.body);
longpoll.publish("/poll", req.body)
res.send("OK");
});
@@ -20,8 +17,3 @@ app.post("/send", (req, res) => {
app.listen(PORT, () => {
console.log(`[server]: Server is running at https://localhost:${PORT}`);
});
-
-// const data: Message = { text: "Some data", color: "#654321", username: "maks" };
-// setInterval(function () {
-// longpoll.publish("/poll", data);
-// }, 5000); \ No newline at end of file