Remove unnecessary 'async' keyword

This commit is contained in:
deepsource-autofix[bot]
2022-09-05 17:25:36 +00:00
committed by GitHub
parent 85b549458d
commit c478f83f70
9 changed files with 35 additions and 35 deletions
+3 -3
View File
@@ -14,11 +14,11 @@ export const setup = function (router, con, server) {
return pid
}
router.get("/api/pid", async function (req, res) {
router.get("/api/pid", function (req, res) {
res.set("Access-Control-Allow-Origin", "*");
res.json({ "pid": createPID() });
});
router.post("/api/post", async function (req, res) {
router.post("/api/post", function (req, res) {
if (!req.body.message) {
res.json({ "error": "no message to post" });
return;
@@ -89,7 +89,7 @@ export const setup = function (router, con, server) {
data: post_obj
};
let messagestr = JSON.stringify(message);
server.wss.clients.forEach(async function (ws) {
server.wss.clients.forEach( function (ws) {
ws.send(messagestr);
});
res.json({ "success": "successfully posted message" });