An api to get information about cat breeds from CatAPI and to keep track of the most searched ones. Complementary to dc-cat-wiki. You can find the application example here (it might take a little while for the server to wake up). Api can be tried here https://elemental-oil-tin.glitch.me/api/.
- TypeScript
- Express 4
- Axios
- CatAPI
- Mocha & Chai
- ESLint
- Babel 7
To run this project, you will need to add the following environment variables to your .env file
ORIGIN
, API_KEY
-
Clone this repository -
git clone https://github.com/sukcinitas/dc-cat-wiki-api.git
, install dependenciescd dc-cat-wiki-api
,npm install
(you will neednpm
andnode
installed globally);npm start
- to run the app on localhost:8080npm run dev
- to run the app on localhost:8080 using nodemonnpm run lint
- to lintnpm run test
- to run testsnpm run build
- to build
Note: in "development" mode unsuccessful responses have additional properties: error
and stack
.
URL & HTTP method | Parameters | req body | Response |
---|---|---|
/api/cats/ GET |
none |
Success response:
|
CatBreedSearchedData{ weight: { imperial: string, metric: string, } id: string, name: string, cfa_url: string, vetstreet_url: string, vcahospitals_url: string, temperament: string, origin: string, country_codes: string, country_code: string, description: string, life_span: string, indoor: number, lap: number, alt_names: string, adaptability: number, affection_level: number, child_friendly: number, dog_friendly: number, energy_level: number, grooming: number, health_issues: number, intelligence: number, shedding_level: number, social_needs: number, stranger_friendly: number, vocalisation: number, experimental: number, hairless: number, natural: number, rare: number, rex: number, suppressed_tail: number, short_legs: number, wikipedia_url: string, hypoallergenic: number, reference_image_id: string, image: { id?: string, url: string, width?: number, height?: number, }, searched: number } |
URL & HTTP method | Parameters | req body | Response |
---|---|---|
/api/cats/search GET |
Query parameters:
|
Success response:
|
SearchedData{ id: string, name: string, } |
URL & HTTP method | Parameters | req body | Response |
---|---|---|
/api/cats/images GET |
Query parameters:
|
Success response:
|
CatBreedImageData{ breeds: [ weight: { imperial: string, metric: string, } id: string, name: string, cfa_url: string, vetstreet_url: string, vcahospitals_url: string, temperament: string, origin: string, country_codes: string, country_code: string, description: string, life_span: string, indoor: number, lap: number, alt_names: string, adaptability: number, affection_level: number, child_friendly: number, dog_friendly: number, energy_level: number, grooming: number, health_issues: number, intelligence: number, shedding_level: number, social_needs: number, stranger_friendly: number, vocalisation: number, experimental: number, hairless: number, natural: number, rare: number, rex: number, suppressed_tail: number, short_legs: number, wikipedia_url: string, hypoallergenic: number, reference_image_id: string, ], id: string, url: string, width: number, height: number } |
URL & HTTP method | Parameters | req body | Response |
---|---|---|
/api/cats/breeds/:breedId GET |
none |
Success response:
|
CatBreedImageData{ breeds: [ weight: { imperial: string, metric: string, } id: string, name: string, cfa_url: string, vetstreet_url: string, vcahospitals_url: string, temperament: string, origin: string, country_codes: string, country_code: string, description: string, life_span: string, indoor: number, lap: number, alt_names: string, adaptability: number, affection_level: number, child_friendly: number, dog_friendly: number, energy_level: number, grooming: number, health_issues: number, intelligence: number, shedding_level: number, social_needs: number, stranger_friendly: number, vocalisation: number, experimental: number, hairless: number, natural: number, rare: number, rex: number, suppressed_tail: number, short_legs: number, wikipedia_url: string, hypoallergenic: number, reference_image_id: string, ], id: string, url: string, width: number, height: number } |