Using a provided data set, implement an Express server that renders content using a templating engine.
- Fork and clone this repository
cd
into thepokemon_templating
directory- Run
npm install
- Start the server with
nodemon server.js
- Visit
localhost:8000/pokemon
to see a table of all Pokemon - Visit
localhost:8000/pokemon/:id
to see an individual Pokemon
Successfully load the files needed to use Materialize to style template content.
- Read this short article: Serving static files in Express.
- Use the
path
module to normalize the path to thepublic
directory. - In the
server.js
file, write a middleware function to serve static files. - Duplicate your existing template files to make two new files titled
index2.ejs
andprofile2.ejs
. - Write the
<meta>
,<link>
, and<script>
tags needed to load the static files for Materialize. - Restyle how the content is rendered using Materialize components.
HINT: The public
directory already includes the static files needed for Materialize and a styles.css
file to define custom styles if wanted.