Files
vercel__workflow/workbench/nest/src/app.controller.ts
Nathan Rajlich 5b5b36a03b [e2e] Remove /api/hook and /api/test-health-check endpoints, call APIs directly
- Remove debug logging from bench.bench.ts
- Remove awaitReturnValue() wrapper, use run.returnValue directly in benchmarks
- Add changeset for Nitro builder manifest fix
- Refactor hookWorkflow tests to call getHookByToken()/resumeHook() directly
  (pass hook object to resumeHook to avoid duplicate lookups)
- Refactor queue-based health check test to call healthCheck() directly
- Assert specific error message for invalid hook token test
- Remove /api/hook and /api/test-health-check endpoints from all workbench apps
  (nextjs-turbopack, nextjs-webpack, vite, hono, express, fastify, sveltekit,
  astro, nuxt, nitro-v2, nitro-v3, nest, example)
2026-02-07 09:00:19 -08:00

23 lines
865 B
TypeScript

import { Body, Controller, Post } from '@nestjs/common';
@Controller('api')
export class AppController {
@Post('test-direct-step-call')
async invokeStepDirectly(@Body() body: { x: number; y: number }) {
// This route tests calling step functions directly outside of any workflow context
// After the SWC compiler changes, step functions in client mode have their directive removed
// and keep their original implementation, allowing them to be called as regular async functions
const { add } = await import('./workflows/98_duplicate_case.js');
const { x, y } = body;
console.log(`Calling step function directly with x=${x}, y=${y}`);
// Call step function directly as a regular async function (no workflow context)
const result = await add(x, y);
console.log(`add(${x}, ${y}) = ${result}`);
return { result };
}
}