Adding EdgeSpec to an existing project npm add edgespec -D Add .edgespec to your .gitignore. Create edgespec.config.ts at your project root: import { defineConfig } from "edgespec" export default defineConfig({ // This an example, adjust as needed routesDirectory: "./src/api", }) Create with-edge-spec.ts: import { createWithEdgeSpec } from "edgespec" export const withRouteSpec = createWithEdgeSpec({ apiName: "An Example API", productionServerUrl: "https://example.com", beforeAuthMiddleware: [], authMiddleware: {}, }) Create a test API route in the directory you defined in edgespec.config.ts: // src/api/hello-world.ts import { withRouteSpec } from "../with-edge-spec" export default withRouteSpec({ methods: ["GET"], })(() => { return new Response("Hello, world!") }) Add a script to your package.json: { "scripts": { "dev": "edgespec dev" } } Run npm run dev and visit http://localhost:3000/hello-world to see your API route!