And that's now it for this course section.
In this course section,
the biggest new feature was of course the additional EJS
of this template language
that allows us to build these enhanced HTML files,
as we could call them,
where we do have our regular HTML code as we know it
with all the features we learned,
but where we got this extra syntax available,
this EJS syntax,
that allows us to actually change the generated HTML content
dynamically on the server.
And we need something like this
to build real websites with dynamic content.
If your website has no dynamic content,
if you just build something like a portfolio page,
then you won't need a template engine,
you might not even need any server-side code.
But if your website has some user-generated content
or some products that change whilst the page is online
and users are visiting it,
whenever you have any kind of content
that's not static but dynamic,
you need a server-side language
to handle that dynamic content.
And you typically need a template engine
to produce dynamic HTML files.
Now you also saw that we got more benefits
than just the dynamic content.
For example, with these includes,
we can also avoid unnecessary code duplication
and we can split our HTML code into smaller reusable pieces,
which makes working on large HTML code bases
easier and more convenient.
Now besides this include feature,
EJS also allows us to output values
like we're doing it here.
As you learned, it then escapes these values
so that any value we output is treated as raw text
unless we use this minus,
this dash here with the EJS syntax,
like we do it for including.
In that case, any HTML content that is encountered
will be treated and rendered as HTML content.
And in EJS, we can also,
besides outputting content in HTML,
also run JavaScript logic like adding an if statement
to render different pieces of content
based on different conditions.
Or we use loops to repeat content
and output multiple restaurants or whatever you have.
Always keep in mind
that what arrives on the front end in the browser
is the finished HTML code.
Here, you won't see that server-side logic.
You won't see that EJS syntax.
Here on the client,
you really just get the finished HTML code.
Now besides the EJS template language,
we also talked about static files
that don't need to be generated or touched on the server,
specifically the CSS and JavaScript files.
With Express, we can easily serve such static files
with help of the built-in static middleware method here,
which we can use to serve the content
of a specific folder,
in this case here, the public folder,
without any further questions.
Therefore, of course, you should make sure
that you only put files into that folder
that should be accessible by every user of your website,
like style files or images.
And with that, we acquired more powerful tools
that we need to build real websites,
and we're now prepared
to take yet another step deeper into Express
and web development.