- 200
- 201
- 204
- 400
- 403
- 404
- 500
- 503
npm i
npm run start
if we do not set a port to be used for the node app, the default port is 3000. Then we have to do a request like:
Endpoint /:code -> returns an "img" (HTML element) that you can embed in your response page or a json with the gif url like this
{ success: true,
gifUrl: "https://media1.giphy.com/media/Rkis28kMJd1aE/giphy.gif"
}
The following Linux bash's commands (yes, I love bash):
curl -s https://giphy.com/search/<your_query>?sort=relevant | grep '"original":' | tr "," "\n" | grep '^ \"url' | cut -f1 -d "?" | grep ".gif"$ | head -4 | tail -1 | cut -f3 -d " " | tr -d '"'