7// Initialize Notion client
8const notion = new Client({
9 auth: Deno.env.get("NOTION_API_KEY"),
10});
11
7// Initialize Notion client
8const notion = new Client({
9 auth: Deno.env.get("NOTION_API_KEY"),
10});
11
7// Initialize Notion client
8const notion = new Client({
9 auth: Deno.env.get("NOTION_API_KEY"),
10});
11
1export default async (c, next) => {
2 const secret = c.req.header("x-api-key");
3 if (secret !== Deno.env.get("X_API_KEY")) {
4 return c.text("Unauthorized", 401);
5 }
9
10 const content = {
11 headline: "👋 Welcome to the root API endpoint of this Hono app, running on val.town",
12 message: "Find more detail in the README.",
13 url: notionURL,
8];
9
10const STEEL_API_KEY = Deno.env.get("STEEL_API_KEY")!;
11if (!STEEL_API_KEY) {
12 console.error("Missing STEEL_API_KEY");
13 Deno.exit(1);
14}
15
16const client = new Steel({ steelAPIKey: STEEL_API_KEY });
17const puppeteer = new PuppeteerDeno({ productName: "chrome" });
18
164 session = await client.sessions.create();
165 browser = await puppeteer.connect({
166 browserWSEndpoint: `wss://connect.steel.dev?apiKey=${STEEL_API_KEY}&sessionId=${session.id}`,
167 });
168 const page = await browser.newPage();
1import { Hono } from "npm:hono@3";
2// import { cors } from "npm:hono@3/cors";
3
4// Import route modules
5import auth from "./routes/auth.ts";
1# Routes Directory
2
3This directory contains all the route handlers for the webhookAPI application. Each file exports a Hono app that handles a specific route or group of related routes.
4
5## Structure
7// Initialize Notion client
8const notion = new Client({
9 auth: Deno.env.get("NOTION_API_KEY"),
10});
11
7// Initialize Notion client
8const notion = new Client({
9 auth: Deno.env.get("NOTION_API_KEY"),
10});
11