Final answer:
To implement HTTP servers using the Express framework, follow the steps outlined here, including setting up the main server, using the Pug template engine, and utilizing the Fetch API for retrieving information about movies and actors.
Step-by-step explanation:
To implement HTTP servers using the express framework, you will need to follow these steps:
- Set up the main server (port 3000) to serve static content such as CSS, scripts, and images using a dedicated route.
- Use the Pug template engine to serve the initial single HTML page.
- Create a single-page website that uses the Fetch API to get information about movies and actors.
- Design an API route using pattern matching, such as 'movies/id007', to make information about movies and actors accessible.
- Store images of movies and associated data in files instead of a database.
- Implement a separate API server (port 3001) to handle the updating of comments and ratings for movies.
- Write a start script that starts both servers via npm start.