【发布时间】:2019-01-02 18:11:29
【问题描述】:
我在我的节点服务器中使用 express.js。
我有一个网页 https://example.com/login.html,我希望在输入 https://example.com/login 时能够访问它。
由于我习惯了 Apache 和 PHP 我知道如何使用 .htaccess 文件来做到这一点,但在 Node.js 中我不知道。
【问题讨论】:
-
您必须使用 express 或其他路由库为其创建路由。
-
如果你从来没有在 node 上工作过 express,那么我建议你关注这个链接。 expressjs.com/en/starter/generator.html