https://github.com/amercier/kitten-as-a-service
Web service written in NodeJS that displays a kitten image randomly picked from Bing Images
https://github.com/amercier/kitten-as-a-service
bing bing-api bing-image image image-search kaas kitten kittens nodejs service web webservice
Last synced: about 1 month ago
JSON representation
Web service written in NodeJS that displays a kitten image randomly picked from Bing Images
- Host: GitHub
- URL: https://github.com/amercier/kitten-as-a-service
- Owner: amercier
- License: isc
- Created: 2017-12-01T12:29:48.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-05-31T00:34:37.000Z (almost 5 years ago)
- Last Synced: 2025-02-15T13:18:42.384Z (3 months ago)
- Topics: bing, bing-api, bing-image, image, image-search, kaas, kitten, kittens, nodejs, service, web, webservice
- Language: JavaScript
- Homepage: https://kitten.amercier.com/
- Size: 3.14 MB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 20
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
kitten-as-a-service
===================> Web service written in NodeJS that displays a kitten image randomly picked from Bing Images.
[](https://travis-ci.org/amercier/kitten-as-a-service)
[](https://codecov.io/github/amercier/kitten-as-a-service?branch=master)
[](https://codeclimate.com/github/amercier/kitten-as-a-service)
[](https://github.com/amercier/kitten-as-a-service/issues?q=label%3Agreenkeeper)_Created with [npm-package-skeleton](https://github.com/amercier/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 100kB
- `medium`: 720p or more, 50kB to 300kB
- `large`: 1080p or more, 100kb to 500kB
- `huge`: 2160p or more, 500kB to 5MBDemo
----- Web: visit http://kitten.amercier.com/
- Download a random kitten image programatically:
```bash
curl --progress-bar -L http://kitten.amercier.com/kitten-huge.jpg -o kitten-huge.jpg
```Requirements
------------- You need an **API key for** the [Bing Images Search API](https://azure.microsoft.com/en-us/services/cognitive-services/bing-image-search-api/).
- The following software:
- [NodeJS](https://nodejs.org/en/) >= 8.9 ([NVM](https://github.com/creationix/nvm) recommended)
- [Yarn](https://yarnpkg.com/en/)MacOS install instructions using Homebrew:
```bash
brew install nvm
nvm install node
npm install -g yarn
```Local setup
-----------1. Clone this repository
```bash
git clone https://github.com/amercier/kitten-as-a-service.git
cd kitten-as-a-service
```
2. Install dependencies
```bash
yarn install
```
3. Start server
```bash
export MICROSOFT_AZURE_API_KEY=********* yarn start
```
4. Visit http://localhost:3000/Deployment
----------Deploy on a NodeJS server (ex: Heroku), with the following environment variables:
- `NODE_ENV` set to `production`
- `MICROSOFT_AZURE_API_KEY` set to your [Bing Images Search API](https://azure.microsoft.com/en-us/services/cognitive-services/bing-image-search-api/) keyAlso, you can set `DEBUG` to `true` to display more verbose logging.
License
-------This project is released under [ISC License](LICENSE.md).
All Microsoft, Bing, Azure brands are property of their respective owners.
All pictures are property of their respective owners.