During the setup, we encountered several warnings when using pm2 and forever to manage the server. These included:
morgan and forever. It can typically be ignored as it doesn’t impact the server’s functionality.forever when these options are not set. This doesn’t affect local development but can be configured as needed for production.The server.js file sets up an Express.js server with a few routes:
/do_a_random: Generates and returns a random number./ITC505/lab-7: Serves the main Mad Lib form from index.html./ITC505/lab-7 [POST]: Processes form submissions, returning a personalized Mad Lib story based on user input.To handle form data, express.urlencoded middleware is used, and static files are served from the public directory.
node server.js local.pm2 or forever to keep the server running:pm2: pm2 start server.jsforever: forever start server.jspm2, use the pm2 logs command to diagnose issues. This helps identify and resolve server-related errors.