Devendra174's picture
Upload folder using huggingface_hub
1e92f2d verified
// Ensure that https://github.com/vercel/next.js/issues/56286 is fixed.
import { NextResponse } from 'next/server'
export async function middleware(req) {
if (req.nextUrl.pathname.includes('rewrite-to-static-first')) {
req.nextUrl.pathname = '/static/first'
return NextResponse.rewrite(req.nextUrl)
}
return NextResponse.next()
}
/**
* @type {import('next/server').MiddlewareConfig}
*/
export const config = {
runtime: 'nodejs',
}