1
2
3
4
5
6
7
8
9
10
11
12
let { waitingList } = await import("https://esm.town/v/unflat/waitingList");
export const joinWaitingList = (req, res) => {
const emailAddress = `${req.query.email}`.toLowerCase();
const emailRegexp =
/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
if (emailRegexp.test(emailAddress) === false) return;
if (waitingList.indexOf(emailAddress) !== -1) return;
waitingList = `${waitingList},${emailAddress}`;
res.set({ "Content-Type": "application/json" });
res.send({ success: true });
};
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
October 23, 2023