如何根据 URL 更改页面内容? Express.js、Node.js

How do I go about changing the contents of a page based on the URL? Express.js, Node.js

好的。我知道这个问题有点令人困惑,所以让我进一步分解我的问题。例如,假设我有 URL:https://example.com. I have an open GET endpoint at: https://example.com/user/* that will return a specific user's information based on what the contents of the "*" is. Lets say a specific user is at: https://example.com/user/12345. On an HTML page, I would like to put that user's profile contents and some of their hobbies. Again, this is theoretical. I have explored various solutions such as Handlebars.js which can dynamically change values based on the server request. However, this solution does not always work. Take a search engine for example at: https://mysearchengine.com/search?query=dogs。在这里,我们有一个关于狗的搜索查询。如何在不使用 Handlebars 等动态内容模块的情况下将所有结果呈现到 HTML 文档?

这个问题特别难问,所以请不要将其标记为“信息不足”。如果您对我的查询的性质有任何疑问,我将非常乐意澄清。非常感谢您,

飞行哥们。

只是想让大家知道我找到了答案:EJS。谢谢!