https://github.com/beaglefoot/fcc-image-search
https://github.com/beaglefoot/fcc-image-search
ejs express imgur-api mongodb mongoose rest
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/beaglefoot/fcc-image-search
- Owner: Beaglefoot
- Created: 2018-05-02T13:51:39.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-05-07T19:05:24.000Z (about 8 years ago)
- Last Synced: 2025-03-29T09:17:58.858Z (about 1 year ago)
- Topics: ejs, express, imgur-api, mongodb, mongoose, rest
- Language: JavaScript
- Homepage: https://fcc-image-search-bf.glitch.me/
- Size: 15.6 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Image Search Abstraction Layer
The fourth project in API section on [freeCodeCamp](https://www.freecodecamp.org/challenges/image-search-abstraction-layer).
### The user stories are:
* I can get the image URLs, alt text and page urls for a set of images relating to a given search string.
* I can paginate through the responses by adding a `?offset=2` parameter to the URL.
* I can get a list of the most recently submitted search strings.
### Examples of usage:
#### Images search:
Input
```
curl -X GET 'https://fcc-image-search-bf.glitch.me/search/cats'
```
Output
```
[
{
"text": "Imgur needs more pics of fat cats",
"page": "https://imgur.com/a/uVfzAL9",
"image": "https://i.imgur.com/c9TkcsQ.jpg"
},
...
]
```
You can provide an additional query parameter for pagination: `?offset=`
#### Recent searches:
Input
```
curl -X GET 'https://fcc-image-search-bf.glitch.me/recent'
```
Output
```
[
{
"query": "cats",
"timestamp": 1525717078149
},
{
"query": "dogs",
"timestamp": 1525687334818
},
...
]
```
You can also choose the amount of recent queries with optional parameter:
```
curl -X GET 'https://fcc-image-search-bf.glitch.me/recent/42'
```