From the course: Web Servers and APIs using C++

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Solution: Create a webpage with data

Solution: Create a webpage with data - C++ Tutorial

From the course: Web Servers and APIs using C++

Start my 1-month free trial

Solution: Create a webpage with data

(upbeat delicate music) - [Instructor] How did you do with this challenge? Hopefully it wasn't difficult. Here's how I solved it. I modified the contact route to pass the contact data. Then I created contact.html by copying contacts.html, and finally I modified the contact's html markup, and added the contact data to it. Let's begin. Go back into Atom, and right here, let's go ahead and modify. The very first unit we need to do, is we're gonna say, crow colon colon json colon colon wvalue and that's gonna be our dto. Then I say dto. The name of the data in the dto is gonna be contact singular. And it's gonna be equal to and I'm just gonna copy everything that is right here except I don't need that last set of parentheses. And the only other thing that I need to do is I need to force send this through json load. So json colon colon load then wrap this parentheses and so this bson to json doc.value.view and that's gonna be our contact data. And then our return object is going to be…

Contents