Skip to main content
Glama
XCTestHTTPServer.swift1.01 kB
import FlyingFox import Foundation enum Route: String, CaseIterable { case runningApp case swipe case swipeV2 case inputText case touch case screenshot case isScreenStatic case pressKey case pressButton case eraseText case deviceInfo case setOrientation case setPermissions case viewHierarchy case status case keyboard case launchApp case terminateApp func toHTTPRoute() -> HTTPRoute { return HTTPRoute(rawValue) } } struct XCTestHTTPServer { func start() async throws { let port = ProcessInfo.processInfo.environment["PORT"]?.toUInt16() let server = HTTPServer(address: try .inet(ip4: "127.0.0.1", port: port ?? 22087), timeout: 100) for route in Route.allCases { let handler = await RouteHandlerFactory.createRouteHandler(route: route) await server.appendRoute(route.toHTTPRoute(), to: handler) } try await server.run() } }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mobile-dev-inc/Maestro'

If you have feedback or need assistance with the MCP directory API, please join our Discord server