Skip to content

Yiqing-Gu/Dog-Image-Search

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dog image search

This is a front-end project based on Node.js and koa web framework.

Functionality

  1. Users can get an image for a specific dog breed thourgh reading input and calling dog API.

  2. Users can get a random dog picture through calling dog API.

  3. There is a test file for random dog pictures.

Launch

Inside this project, run

node main.js

If the server starts successfully, you will see

Server running on http://localhost:3011

in the terminal. At the same time, a web page will appear.

Users can search through a specific dog breed or getting a random image.

Test

A middleware called "Jest" is used and needed here. Test file is in dogs-main_tests_ and called "routes.test.js".

npm install -D jest supertest

Package.json should have been revised. If not, please revise in the following way.

//package.json "scripts": { "test": "jest --watchAll", },

After setting an expecting status code, console will compare real status code and print a url for the random image.

Run the following command to start testing.

npm run test

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published