GitXplorerGitXplorer
m

errorGiphy-service

public
1 stars
0 forks
40 issues

Commits

List of commits on branch master.
Unverified
680b614f9148663de940e6108ff374432b2fe2f9

fix: package.json, package-lock.json & .snyk to reduce vulnerabilities

ssnyk-bot committed 5 years ago
Unverified
8ae540ad6a54c7ae7a1974015f2d3371144b10d0

fix: package.json, package-lock.json & .snyk to reduce vulnerabilities

ssnyk-bot committed 5 years ago
Unverified
f3dcfbf4dc688f89119b2f531f8a7413f1d8cf7f

fix: package.json, package-lock.json & .snyk to reduce vulnerabilities

ssnyk-bot committed 5 years ago
Unverified
e1c8912b95d72f6082c6980fe1195359d7458ad4

fix: package.json & package-lock.json to reduce vulnerabilities

ssnyk-bot committed 5 years ago
Verified
eb194d3473f509aa886408a5d15549608bba60a3

Merge pull request #13 from mrm8488/dependabot/npm_and_yarn/minimist-1.2.5

mmrm8488 committed 5 years ago
Verified
cdc23d8f44d3c5f78ed6ce582e1711ab4cd4c526

Bump minimist from 1.2.0 to 1.2.5

ddependabot[bot] committed 5 years ago

README

The README file for this repository.

Known Vulnerabilities

errorGiphy-service

A Microservice based on Linux bash's commands to get a funny gif for HTTP response codes

we manage the following codes by now:

  • 200
  • 201
  • 204
  • 400
  • 403
  • 404
  • 500
  • 503

How to use:

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 / -> returns OK meaning that the service is up and working!

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"
 }

Live demo for status 200

Live demo for error 404

Live demo for error 500

What is the core?

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 '"'