response.renderinstead of sending response data directly to the client. EJS will inject our data into the relevant HTML template and send the merged HTML to the client.
mainbranch for this exercise.
styles.cssfile, we need to enable Express' built-in file server and configure it to serve files from the folder where our CSS is. The following expression enables Express to serve files from a local folder called
public. Read more about static files here and
public. Move all CSS files to this folder.
app.use(express.static(...))) to our
index.jsfile above our routes to enable the file server.
publicfolder. The URL path can be a relative path relative to the
/) to contain a list with 1 link per category.