Skip to content

Commit

Permalink
fix: update comments
Browse files Browse the repository at this point in the history
  • Loading branch information
yonycalsin committed Nov 8, 2022
1 parent 68f603f commit 65165c3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import cors, { CorsOptions, CorsOptionsDelegate } from 'cors'
import { NextApiRequest, NextApiResponse } from 'next'

// - Helper method to wait for a middleware to execute before continuing
// - And to throw an error when an error happens in a middleware
// Helper method to wait for a middleware to execute before continuing
// And to throw an error when an error happens in a middleware
function initMiddleware(middleware: typeof cors) {
return (req: NextApiRequest, res: NextApiResponse, options?: CorsOptions | CorsOptionsDelegate) =>
new Promise((resolve, reject) => {
Expand All @@ -16,7 +16,7 @@ function initMiddleware(middleware: typeof cors) {
})
}

// - You can read more about the available options here: https://github.com/expressjs/cors#configuration-options
// You can read more about the available options here: https://github.com/expressjs/cors#configuration-options
const NextCors = initMiddleware(cors)

export default NextCors

0 comments on commit 65165c3

Please sign in to comment.