Skip to content

Commit

Permalink
updated video sources
Browse files Browse the repository at this point in the history
  • Loading branch information
steveyout committed Jul 20, 2024
1 parent 8999fc5 commit 5f1a54a
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions pages/middleware.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { NextResponse } from "next/server";

export function middleware() {
// retrieve the current response
const res = NextResponse.next()

// add the CORS headers to the response
res.headers.append('Access-Control-Allow-Credentials', "true")
res.headers.append('Access-Control-Allow-Origin', '*') // replace this your actual origin
res.headers.append('Access-Control-Allow-Methods', 'GET,DELETE,PATCH,POST,PUT')
res.headers.append(
'Access-Control-Allow-Headers',
'X-CSRF-Token, X-Requested-With, Accept, Accept-Version, Content-Length, Content-MD5, Content-Type, Date, X-Api-Version'
)

return res
}

// specify the path regex to apply the middleware to
export const config = {
matcher: '/api/:path*',
}

0 comments on commit 5f1a54a

Please sign in to comment.