Releases: egoist/vite-vercel
Releases · egoist/vite-vercel
v0.1.14
Now FetchEvent
is also available in the middleware:
import type { MiddlewareFetchEvent, MiddlewareRequest } from 'vite-vercel/server';
export default (req: MiddlewareRequest, event: MiddlewareFetchEvent) => {
const url = new URL(req.url)
if (url.pathname === '/responses/send-response') {
const { readable, writable } = new TransformStream();
event.waitUntil(
(async () => {
const writer = writable.getWriter();
const encoder = new TextEncoder();
writer.write(encoder.encode('Hello, world! Streamed!'));
writer.write(encoder.encode('response'));
writer.close();
})(),
);
return new Response(readable);
}
}
v0.1.9
- Feat: adding
MiddlewareResponse.rewrite
,MiddlewareResponse.redirect
andMiddlewareRequest
- Feat: Adding
isBot
export invite-vercel/server
- Fix: Creating production build using Vite instead of esbuild
Full Changelog: v0.1.7...v0.1.9