/fcc-image-search-abstraction-zklinger

A full stack JavaScript app that allows you to search for images and see a list of recent queries.

Primary LanguageJavaScript

fcc-image-search-zklinger

FreeCodeCamp Social Banner

A full stack JavaScript app that allows you to search for images and see a list of recent queries.

API Basejump: Image Search Abstraction Layer

User stories:

  1. I can get the image URLs, alt text and page urls for a set of images relating to a given search string.
  2. I can paginate through the responses by adding a ?offset=2 parameter to the URL.
  3. I can get a list of the most recently submitted search strings.

Example usage:

https://fcc-image-search-zklinger.herokuapp.com/api/imagesearch/ + search terms + ?offset=10
Like:
https://fcc-image-search-zklinger.herokuapp.com/api/imagesearch/lolcats%20funny?offset=10

Example output:

{
  "url": "http://google.com/dsfa/adsfdfsasd?234/234234/2/ddsfsfd.jpg",
  "snippet": "Funny lolcats (photo...",
  "thumbnail": "http://google.com/dsfa/adsfdfsasd?234/234234/2/ddsfsfd.jpg",
  "context": "https://fcc-image-search-zklinger.herokuapp.com/25",
}

Example usage:

To get a list of recent search terms:
https://fcc-image-search-zklinger.herokuapp.com/api/latest/imagesearch/

Built as a Node.js app using Express 4.

This application came from the Getting Started with Node on Heroku article - check it out.

Running Locally

Make sure you have Node.js installed and mongod running.

$ git clone https://github.com/zklinger2000/fcc-image-search-zklinger.git
$ cd fcc-image-search-zklinger
$ npm install
$ npm start

Your app should now be running on localhost:5000.

Documentation

For more information about using Node.js on Heroku, see these Dev Center articles: