Learn about creating an API endpoint for a single contest and using it with an application API module. Learn about replacing an object property.
- [Instructor] Let's now fetch one contest information…from an API when we click on it.…'Cause right now, we don't go to the server.…When we click on a contest, we need to go to the server…and ask the server about more information…about that contest.…For example, its description and eventually…any names that we proposed already on this contest.…So let's start with an API.…We need to go to /contest/ the id of the contest…to look up a contest by id; right now we don't have that.…So this is simple. Under API index,…let's introduce a new route.…
This route will be /contests/:contestID.…This is how we do it with express.…And once we actually do the request here,…the id that we put in the URL…is going to be available as req.params.contestId.…So really what I want to do is…I want to look up a contest here, contest equal.…I'm going to look it up from contest, which is my object,…using this req.params.contestId…and this would give me the contest object.…
Now I don't have any extra information about the contest…because we're still working with fake data.…
- Configuring webpack and Babel
- Working with native Node modules
- Creating an Express server
- Working with React components and JSX
- Loading and working with test mock data
- Fetching data from a remote API
- Working with data in MongoDB
- Isomorphic rendering on the server
- Front-end routing and back-end routing
Skill Level Advanced
Building a Website with Node.js and Express.jswith Ray Villalobos3h 16m Intermediate
MEAN Stack and MongoDB: Development Techniqueswith Alexander Zanfir1h 48m Intermediate
1. Getting Started
2. Node as a Web Server
3. React Basics
4. Working with Data
5. Rendering on the Server
Fix the checksum problem6m 11s
6. Routing on Client and Server
7. Working with MongoDB
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.