tangled
alpha
login
or
join now
finxol.io
/
hooks
0
fork
atom
Simple API gateway for webhooks
0
fork
atom
overview
issues
pulls
pipelines
log what's received
finxol.io
6 months ago
d71ba0ab
a07f128b
verified
This commit was signed with the committer's
known signature
.
finxol.io
SSH Key Fingerprint:
SHA256:olFE3asYdoBMScuJOt60UxXdJ0RFdGv5kVKrdOtIcPI=
1/1
deploy.yaml
success
14s
+12
-1
2 changed files
expand all
collapse all
unified
split
src
main.ts
sensors.ts
+2
src/main.ts
···
2
2
import { uaBlocker } from "@hono/ua-blocker"
3
3
import { aiBots, useAiRobotsTxt } from "@hono/ua-blocker/ai-bots"
4
4
import { config } from "../config.ts"
5
5
+
import { sensors } from "./sensors.ts"
5
6
6
7
const app = new Hono()
8
8
+
.route("/sensors", sensors)
7
9
.get("/robots.txt", useAiRobotsTxt())
8
10
.use(
9
11
"*",
+10
-1
src/sensors.ts
···
1
1
import { Hono } from "hono"
2
2
3
3
-
export const app = new Hono().get("/", (c) => c.text("Hello World!"))
3
3
+
const sensors = new Hono().get("/get", (c) => c.text("Hello World!")).post(
4
4
+
"/set",
5
5
+
async (c) => {
6
6
+
const body = await c.req.text()
7
7
+
console.log(body)
8
8
+
return c.text(`Received: ${body}`)
9
9
+
},
10
10
+
)
11
11
+
12
12
+
export { sensors }