Join Troy Miles for an in-depth discussion in this video Adding dynamic data to a page, part of Web Servers and APIs using C++.
- [Narrator] We've written our first database query,…but the output is pretty ugly.…Let's change that.…Crow supports a logic list template system named mustache.…Mustache makes our C++ data available…when the HTML page renders.…To use mustache, we need to make a few changes to our code.…So let's go ahead and return to Atom,…and the very first change that we need to make…is just below the namespace crow,…we're gonna say using namespace crow::mustache.…
Next we're gonna add a function called getview,…and it's gonna return a type of string…and getview, and it's gonna take in a const string reference…to filename and a context, context, reference called x,…open and closed parentheses.…This has just one line, that one line is return load,…and we're gonna say filename plus .HTML,…so we're adding HTML to the end of the line.…
Gonna do a .render x semicolon,…then we need to just make one more small change.…We're gonna copy this ..public and the plus sign…and add it here as well.…Then we're gonna scroll down to the main function.…
- Working with Crow, the C++ micro web framework
- Deploying containers to Heroku
- Building websites and webpages
- Accessing data from a database
- Accessing data via RESTful APIs
- Creating API endpoints
- Running WebSockets on Heroku
Skill Level Intermediate
1. Installing Our Tools
2. Deploying to Heroku
Installing the Heroku CLI1m 17s
3. Building Websites
4. Data Access
5. RESTful APIs
6. WebSockets and Crow
- 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.