When the environment variable CI
equals true
, pnpm run ci
will all the automatic tests. When the environment variable CI
does not equal true
, pnpm run ci
will run its tests on an already running server. You can set the server address by setting the environment variable TEST_HOST
which defaults to http://127.0.0.1:3000
.
To manually test streaming, run curl -ND - 'http://127.0.0.1:3000/bin-stream?delay=50'
and observe the typewriter effect.
All environments that provide a local development server are tested automatically. But testing actual deployments is also desirable. Follow the instructions below to test deployments.
Publish with wrangler publish
.
Build locally with pnpm build:vercel
and deploy with vercel deploy --prebuilt
.
Not supported:
- Custom status text
- Request cancelation
Build locally with pnpm build:vercel-edge
and deploy with vercel deploy --prebuilt
.
Not supported:
- Custom status text
- Request cancelation
- Content-Length in simple text response
Build locally with pnpm build:netlify-functions
, deploy with netlify deploy
.
Not supported:
- Always uses chunked encoding when without compression
- Streaming responses
- Custom status text
- Request cancelation
Build locally with pnpm build:netlify-edge
, deploy with netlify deploy
.
Not supported:
- Always uses chunked encoding when without compression
- Custom status text
Build with pnpm build:deno
, cd
into dist/deno
and deploy with deployctl deploy --token <TOKEN> --project=<PROJECT> index.js
.
Not supported:
- Custom status text
Change InvokeMode
to whatever you want and deploy with node aws-deploy.js deploy
. Destroy with node aws-deploy.js destroy
.
Not supported:
- Streaming responses only supported with
@hattip/adapter-aws-lambda/streaming
- Always uses chunked encoding when without compression
- Custom status text
- Request cancelation