Skip to content

armgit / E2B

Public Imported from GitHub
0

Open-source, secure environment with real-world tools for enterprise-grade agents.

Change sidebar color

Vasek Mlejnsky83bbc8d8b134
diff --git a/api-service/cf-worker-template/index.js b/api-service/cf-worker-template/index.js
index 948217346..4f0bddfa5 100644
--- a/api-service/cf-worker-template/index.js
+++ b/api-service/cf-worker-template/index.js
@@ -3,13 +3,15 @@ import { Router } from 'itty-router'
const router = Router()
async function handlepostRequest(request) {
- const data = await request.json();
- const { email } = data;
+ const body = await request.json()
+ const { email } = body
const regex = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
if (!regex.test(String(email).toLowerCase())) {
- return new Response(JSON.stringify({ error: 'Invalid email' }), { status: 400 });
+ return new Response(JSON.stringify({ error: 'Invalid email' }), { status: 400 })
}
- return new Response(JSON.stringify({ message: 'Ok' }), { status: 200 });
+ // save email to Supabase DB
+ // respond with "Ok" message in JSON
+ return new Response(JSON.stringify({ message: 'Ok' }), { status: 200 })
}
router.post('/', handlepostRequest)