Giter VIP home page Giter VIP logo

booksearch's Introduction

AJAX Books

In this activity we will add functionality to a full stack React application for retrieving books from a database.

Instructions

  • Open the Unsolved folder in your editor and run npm install at the project's root.

  • This application uses a Mongo database, so be sure to start mongod.

  • In order to initially populate the database, run the following command at the project root: npm run seed.

  • This should insert a few records into the MongoDB.

  • Run npm start at the project root to start the application.

  • Open your browser to localhost:3000 and take a moment to study the rendered application.

    • This example is a reading list application. Currently the app isn't fully functional.
  • Open up client/src/pages/Books.js and add code so that when the component mounts, it performs an AJAX request to retrieve all of the books in the database. Once the AJAX request is complete, it should set this.state.books equal to the array of books.

  • If successful, a list of books should be rendered on the right side of the page.

    • We'll work on making the form functional in the next activity.

Hints

  • Use the API helper module (client/src/utils/API.js) to perform an AJAX request which should return all of the books in the database.

  • The only file you will need to modify is client/src/pages/Books.js.

booksearch

booksearch's People

Contributors

jepidoptera 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.