Skip to content

Commit

Permalink
Add Interclip files API
Browse files Browse the repository at this point in the history
  • Loading branch information
filiptronicek committed Mar 16, 2021
1 parent ee998db commit 1750789
Show file tree
Hide file tree
Showing 2 changed files with 761 additions and 1 deletion.
19 changes: 19 additions & 0 deletions api/interclip/files.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { NowResponse } from '@vercel/node';
import fetch from "node-fetch";

export default (_req: any, res: NowResponse) => {
fetch("https://interclip.app/includes/size.json").then((r) => {
if (r.ok) {
const responce = r.json();
return responce;
} else {
return null;
}
}).then(resp => {
if (resp === null) {
res.send({status: "error", result: "Error in fetching file stats"})
} else {
res.send(resp);
}
})
}
Loading

1 comment on commit 1750789

@vercel
Copy link

@vercel vercel bot commented on 1750789 Mar 16, 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.