Last active
October 9, 2018 10:01
-
-
Save danhollick/d2019caaaee67165075c5976db6137e2 to your computer and use it in GitHub Desktop.
Async server request
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var express = require('express') | |
| var fetch = require('isomorphic-fetch') | |
| const FigmaAPIKey = 'mysecretkey' | |
| const FigmaFileID = 'VAyAHaZn1tHmjOFK79pbnMTj' | |
| async function figmaFileFetch(fileId){ | |
| let result = await fetch('https://api.figma.com/v1/files/' + fileId , { | |
| method: 'GET', | |
| headers: { | |
| 'X-Figma-Token': FigmaAPIKey | |
| } | |
| }) | |
| let figmaFileStruct = await result.json() | |
| return figmaFileStruct | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment