📌 Documentation for @hyperse/inspector and related packages.
Code Inspector
Configuration

Middleware

createLaunchEditorMiddleware from @hyperse/inspector-middleware.

Middleware (@hyperse/inspector-middleware)

import { createLaunchEditorMiddleware } from '@hyperse/inspector-middleware';

app.use(
  createLaunchEditorMiddleware({
    projectCwd: process.cwd(),
    customLaunchEditorEndpoint: '/__hps_inspector',
    trustedEditor: 'cursor',
  })
);

CreateLaunchEditorMiddlewareOptions

FieldDescription
projectCwdRoot used to resolve fileName from the query string. Default process.cwd().
customLaunchEditorEndpointURL prefix to handle. Default launchEditorEndpoint from @hyperse/inspector-common (/__hps_inspector).
trustedEditorFallback editor when the request does not specify one. Defaults to process.env.LAUNCH_EDITOR.

The handler validates trusted editors before spawning launch-editor. Unknown editor query values are rejected with 400.

On this page