Public
HTTP (deprecated)
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Readme

Send/receive sms from val.town

Test sending/receiving sms from SMSHub

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import { extractValInfo } from "https://esm.town/v/pomdtr/extractValInfo";
import { readmeToHtmlResponse } from "https://esm.town/v/pomdtr/readme";
import { Hono } from "npm:hono";
const app = new Hono();
const { author, name } = extractValInfo(import.meta.url);
app.get("/", c => readmeToHtmlResponse(author, name));
app.post("/send", async (c) => {
const {} = await c.req.formData();
return c.json({ "message": "hola mundo!", "number": "0755689012", "messageId": "1" });
});
app.post("/status", async (c) => {
const data = await c.req.formData();
console.log(data);
return new Response("OK");
});
app.post("/receive", async (c) => {
const data = await c.req.formData();
console.log(data);
return new Response("OK");
});
export default app.fetch;
pomdtr-sms.web.val.run
June 2, 2024