GithubHelp home page GithubHelp logo

search-page-api's Introduction

Search Page API

Build a searchable, pageable explorer for an API of your choice.

Process Requirements

  1. Commit regularly (at least every 15-20 minutes). Demonstrate your thinking through regular incremental commits. Solo builds without an incremental commit history will not pass.
  2. TDD every function that does not directly manipulate the DOM; template functions, query write/read, make search api url. If these functions are not driven by tests (demonstrated by commit history) the build will not pass.

API

Pick an API that:

  1. Has CORS enabled
  2. Accepts a search/query term
  3. Supports paging

You will likely need to sign up for an API key.

Not sure? Two good sources for movies: https://www.themoviedb.org or https://www.omdbapi.com

Pages

This will be a single page app. It offers a simple form with one text input and a button for the user to enter their search term. It should also have a paging control for advancing through the pages

Using the API

TDD a function that takes the search and page inputs and returns the correct URL for your API. Consider using the built-in URL class to create and format the url. If search term is required and is missing, return an empty string so you can detect not to run the search.

Store search and page in the URL

Using the URLSearchParams built in class, format a query string, but store it in window.location.hash (this will keep our page from refreshing!). You can use the function directly from the search and paging components (no callback needed!)

Load from hash

In index.js subscribe to the window hashChange event and call a function that runs the API based on the hash values. You should call this function on page load as well.

search-page-api's People

Contributors

chrispiccaro18 avatar martypdx avatar willemlarsen avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.