Join Daniel Khan for an in-depth discussion in this video Working with conditionals, part of Building a Website with Node.js and Express.js.
- [Instructor] In the design, we see that some pages…contain a sidebar with artwork.…On the index page, this is all artwork,…all speakers, also, on the all speakers page,…this is all artwork, and on the speaker's detail page,…this is the artwork for a given speaker.…So, we want to make this now dynamic, as well,…so for that, let's first look into…what we have in our data JSON objects.…Open data speakers.json, and we see that…each speaker has a property artwork…that contains an array with different image file names,…and those image file names point actually,…in our case, into the image directory artwork,…and there you see we have all these image files,…which maybe have been uploaded through some admin panel.…
Now, to get all the artwork there is,…we have to add a new function, so SpeakerService,…so right after getList, I add now,…async getAllArtwork, and in there, first of all,…we again want to get data, simply…copied it over from the getList function.…Next, we want to get the artwork…out of all those speaker objects.…
- Creating a server with Express and pure Node.js
- Handling errors in Express
- Creating routes
- Using templates
- Working with the Pug template engine
- Implementing the site structure and logic
- Working with conditionals
- Dealing with POST requests
- Sanitizing user inputs and handling form errors
Skill Level Beginner
What you should know1m 40s
1. Getting Started
2. Express Basics
3. Getting Started with Our Project
4. Getting Started with Templates
5. Implementing the Site Structure and Logic
6. Handling Form Data
- 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.