@mockkit/viewer
v0.0.14
Published
`@mockkit/viewer` is a package for running a local MockKit Viewer server on your machine.
Downloads
288
Readme
@mockkit/viewer
@mockkit/viewer is a package for running a local MockKit Viewer server on your machine.
This viewer proxies and displays the site at the URL you specify. If the site uses MockKit tags, developer notes will be presented in an easy-to-read format.
Certain parts of this package are designed for MockKit service on Cloudflare and Supabase; these are only relevant to MockKit administrators and can be disregarded by most users.
Under the hood, it uses Wrangler as the local server runtime.
Getting Started
pnpm install
cp wrangler.jsonc.example wrangler.jsoncIn wrangler.jsonc, set the URL you want the viewer to proxy in the DEFAULT_UPSTREAM field (for example, http://localhost:3000).
Usage in dev mode
pnpm @mockkit/viewer run devAfter startup, open the local URL shown in the terminal (typically http://localhost:8787/~/).
Standalone usage (via npx/dlx)
npx @mockkit/viewer serve --upstream http://example.comOptions
These options are available only in standalone mode and cannot be used in dev mode.
npx @mockkit/viewer serve --port 8888
npx @mockkit/viewer serve --host 0.0.0.0
npx @mockkit/viewer serve --upstream http://localhost:8080--port,-p: Port for the Viewer server to listen on--host: Host/IP for the Viewer server to bind to--upstream,-u: SetDEFAULT_UPSTREAMat runtime
Additional wrangler dev options can be passed after --:
npx @mockkit/viewer serve -- --inspector-port 9229