Web service written in NodeJS that displays a kitten image randomly picked from Bing Images.
Created with npm-package-skeleton.
The web service exposes mainly two URLs:
/
: a web page, written in HTML/CSS/JS/kitten-{size}.jpg
: the endpoint for the random image, which can be used programatically, where{size}
is one of the following:small
: 480p or more, 30kB to 100kBmedium
: 720p or more, 50kB to 300kBlarge
: 1080p or more, 100kb to 500kBhuge
: 2160p or more, 500kB to 5MB
- Web: visit http://kitten.amercier.com/
- Download a random kitten image programatically:
curl --progress-bar -L http://kitten.amercier.com/kitten-huge.jpg -o kitten-huge.jpg
- You need an API key for the Bing Images Search API.
- The following software:
MacOS install instructions using Homebrew:
brew install nvm
nvm install node
npm install -g yarn
- Clone this repository
git clone https://github.com/amercier/kitten-as-a-service.git
cd kitten-as-a-service
- Install dependencies
yarn install
- Start server
export MICROSOFT_AZURE_API_KEY=********* yarn start
- Visit http://localhost:3000/
Deploy on a NodeJS server (ex: Heroku), with the following environment variables:
NODE_ENV
set toproduction
MICROSOFT_AZURE_API_KEY
set to your Bing Images Search API key
Also, you can set DEBUG
to true
to display more verbose logging.
This project is released under ISC License. All Microsoft, Bing, Azure brands are property of their respective owners. All pictures are property of their respective owners.