An API that gives links to images given the query and number of results desired. Uses google custom search API.
Clone the project
git clone https://github.com/khansubhan95/timestamp-microservice.git
run
npm install
to install the dependencies
Rename .env.template to .env
The project uses MongoDB to store data so make sure you have it installed. Use the MONGO_URI to make sure that the service has access to a DB
Also sign up for google custom search API and insert the API_KEY and CX in the .env file.
MONGO_URI Use a third party service like mLab to make a MongoDB database and note down the access point.
Remaining variables remain the same
Given a valid url endpoint of the form /api/imagesearch/{query}?offset={number} , gives {number} images corresponding to the search term {query}.
returns An array of 10 objects with each object corresponding to a particular search query.
Given a valid url endpoint of the form /api/latest/imagesearch , gives the last 10 search queries and the time at which they were queried
/api/imagesearch/cats?offset=10
returns An array of 10 objects with each object corresponding to a single image obtained from the query 'cats'
View other dependencies in package.json
MIT