A wrapper around Giphy API to make requests without leaking API Key. Made with express
and serverless
, tested with jest
.
Anyone working with the Giphy API knows that requests have to be made with the API key visible. The workaround is to use Giphy's wrapper but I realized it is easier to keep a standalone service that "acts" like Giphy server but only abstracts away from the API Key requirement. Since the service is hosted with AWS Lambda, it can scale according to the needs of demand. Overall, it was quite fun to fulfill my idea. I got to learn about the wonderful express and serverless integration. All configurations are separate from app logic, making deployment a breeze.
Giphy API provides the API Key for each developer. It can saved as an enviroment variable named API_KEY
to be read by the Express app. For AWS, this project uses AWS Named Profiles in the serverless
configuration.
-
Dev server: For manual tests and development purposes, the Express server is available in
src
directory. From a terminal, runnpm start
and open
http://localhost:8000/api/gifs
for the results. -
Build for Serverless & deploy from terminal
npm run deploy
-
Unit-testing: Tests are written using Jest. From a terminal, run
npm run test
MIT