Skip to content

Commit

Permalink
allow cors
Browse files Browse the repository at this point in the history
  • Loading branch information
italodeandra committed Apr 3, 2021
1 parent 184f4a5 commit 1991974
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/pages/api/listWatchedVideos.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import WatchedVideo, { IWatchedVideoReqQuery } from "../../models/WatchedVideo"
import { NextApiHandler } from "next"
import { connectDb, runMiddleware } from "../../middlewares"
import { connectDb, cors, runMiddleware } from "../../middlewares"

const listWatchedVideos: NextApiHandler = async (req, res) => {
await runMiddleware(req, res, cors)
await runMiddleware(req, res, connectDb)

const userId = req.query.userId as IWatchedVideoReqQuery["userId"]
Expand Down

1 comment on commit 1991974

@vercel
Copy link

@vercel vercel bot commented on 1991974 Apr 3, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.