MCPcopy
hub / github.com/steel-dev/steel-browser / routes

Function routes

api/src/modules/actions/actions.routes.ts:6–78  ·  view source on GitHub ↗
(server: FastifyInstance)

Source from the content-addressed store, hash-verified

4import { PDFRequest, ScrapeRequest, ScreenshotRequest, SearchRequest } from "./actions.schema.js";
5
6async function routes(server: FastifyInstance) {
7 server.post(
8 "/scrape",
9 {
10 schema: {
11 operationId: "scrape",
12 description: "Scrape a URL",
13 tags: ["Browser Actions"],
14 summary: "Scrape a URL",
15 body: $ref("ScrapeRequest"),
16 response: {
17 200: $ref("ScrapeResponse"),
18 },
19 },
20 },
21 async (request: ScrapeRequest, reply: FastifyReply) =>
22 handleScrape(server.sessionService, server.cdpService, request, reply),
23 );
24
25 server.post(
26 "/screenshot",
27 {
28 schema: {
29 operationId: "screenshot",
30 description: "Take a screenshot",
31 tags: ["Browser Actions"],
32 summary: "Take a screenshot",
33 body: $ref("ScreenshotRequest"),
34 response: {
35 200: $ref("ScreenshotResponse"),
36 },
37 },
38 },
39 async (request: ScreenshotRequest, reply: FastifyReply) =>
40 handleScreenshot(server.sessionService, server.cdpService, request, reply),
41 );
42
43 server.post(
44 "/pdf",
45 {
46 schema: {
47 operationId: "pdf",
48 description: "Get the PDF content of a page",
49 tags: ["Browser Actions"],
50 summary: "Get the PDF content of a page",
51 body: $ref("PDFRequest"),
52 response: {
53 200: $ref("PDFResponse"),
54 },
55 },
56 },
57 async (request: PDFRequest, reply: FastifyReply) =>
58 handlePDF(server.sessionService, server.cdpService, request, reply),
59 );
60
61 server.post(
62 "/search",
63 {

Callers

nothing calls this directly

Calls 5

$refFunction · 0.85
handleScrapeFunction · 0.85
handleScreenshotFunction · 0.85
handlePDFFunction · 0.85
handleSearchFunction · 0.85

Tested by

no test coverage detected