Buckets:
| import { NextResponse } from 'next/server' | |
| import { notUsingEval, usingEval } from './lib/utils' | |
| import { | |
| usingWebAssemblyCompile, | |
| usingWebAssemblyInstantiate, | |
| usingWebAssemblyInstantiateWithBuffer, | |
| } from './lib/wasm' | |
| export async function middleware(request) { | |
| if (request.nextUrl.pathname === '/using-eval') { | |
| return new Response(null, { | |
| headers: { data: JSON.stringify(await usingEval()) }, | |
| }) | |
| } | |
| if (request.nextUrl.pathname === '/not-using-eval') { | |
| return new Response(null, { | |
| headers: { data: JSON.stringify(await notUsingEval()) }, | |
| }) | |
| } | |
| if (request.nextUrl.pathname === '/using-webassembly-compile') { | |
| return new Response(null, { | |
| headers: { data: JSON.stringify(await usingWebAssemblyCompile(9)) }, | |
| }) | |
| } | |
| if (request.nextUrl.pathname === '/using-webassembly-instantiate') { | |
| return new Response(null, { | |
| headers: { data: JSON.stringify(await usingWebAssemblyInstantiate(9)) }, | |
| }) | |
| } | |
| if ( | |
| request.nextUrl.pathname === '/using-webassembly-instantiate-with-buffer' | |
| ) { | |
| return new Response(null, { | |
| headers: { | |
| data: JSON.stringify(await usingWebAssemblyInstantiateWithBuffer(9)), | |
| }, | |
| }) | |
| } | |
| return NextResponse.next() | |
| } | |
| export const config = { | |
| matcher: [ | |
| '/using-eval', | |
| '/not-using-eval', | |
| '/using-webassembly-compile', | |
| '/using-webassembly-instantiate', | |
| '/using-webassembly-instantiate-with-buffer', | |
| ], | |
| } | |
Xet Storage Details
- Size:
- 1.45 kB
- Xet hash:
- 6e857acf7a904433011e0b7753b7077d17d0342dc9ebe80b92fd1e915811ebf4
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.