Skip to content

Commit

Permalink
Add comment to pages/api/comments.js
Browse files Browse the repository at this point in the history
This comment described rationale to why we created this api endpoint
  • Loading branch information
iAdramelk committed Dec 4, 2019
1 parent 64b0749 commit 6b9d01a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pages/api/comments.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
/*
* This API endpoint is used by https://blog.dvc.org
* to get comments count for the post, it gets
* discuss.dvc.org topic url as a param and returns
* comments count or error.
*
* It made this way to configure CORS, reduce user's payload
* and to add potential ability to cache comments count
* in the future.
*/

import Cors from 'micro-cors'
import request from 'request'

Expand Down

0 comments on commit 6b9d01a

Please sign in to comment.