Added regex

This commit is contained in:
Henry Hiles 2022-02-28 16:49:22 -05:00
parent 3a2704011c
commit 1fefb44b51
4 changed files with 47 additions and 6 deletions

View file

@ -31,7 +31,7 @@ app.get("/", (_, res) => {
})
app.post("/", (req, res) => {
if (rooms[req.body.room] != null) {
if (!req.body.room.trim() || rooms[req.body.room]) {
return res.redirect("/")
}
rooms[req.body.room] = { users: {} }