Created
November 19, 2024 09:25
-
-
Save tobySolutions/7178b489d20259f6980ea3462d3fc8dc to your computer and use it in GitHub Desktop.
Fleek Function Quote Example
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
import axios from "axios"; | |
export const main = async (params) => { | |
let response = await axios.get( | |
"https://api.api-ninjas.com/v1/quotes?category=happiness", | |
{ | |
headers: { | |
"X-Api-Key": "yourApiNinjasApiKey", | |
}, | |
}, | |
); | |
let quote = response.data[0].quote + "\n\n" + "~" + response.data[0].author; | |
return quote; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment