This is a little trick. I always feel uncomfortable looking at the .ejs suffix. Use the following method to change the suffix of the template file to the .html we are used to.
1. Define ejs at the head of app.js:
2. Register html template engine:
3. Change the template engine to html:
4. Modify the suffix of the template file to .html.
Okay, the task is completed, you can run and watch the effect!
The above is the entire content of this article, I hope you all like it.