相关疑难解决方法(0)

使用Angular2处理404

如果输入了无效路径,有没有办法配置Angular2路由器重定向到特定路由?

例如,如果我有三条路线:
/ home
/ about
/ 404

我输入/训练(路线,路线配置中不存在),我希望路由器将我重定向到404.

typescript angular2-routing angular

22
推荐指数
1
解决办法
7371
查看次数

使用 express 时找不到模块

我想在电子应用程序中公开 REST 服务,并且我想将 expressJS 与电子一起使用,如教程所述,我添加了 express 和 @types/express。我试图公开一个“get”,但是当我构建并运行它时会抛出以下内容。

跑着 ng build --prod

ERROR in ./node_modules/cookie-signature/index.js
Module not found: Error: Can't resolve 'crypto' in 'app\node_modules\cookie-signature'
ERROR in ./node_modules/etag/index.js
Module not found: Error: Can't resolve 'crypto' in 'app\node_modules\etag'
ERROR in ./node_modules/destroy/index.js
Module not found: Error: Can't resolve 'fs' in 'app\node_modules\destroy'
ERROR in ./node_modules/etag/index.js
Module not found: Error: Can't resolve 'fs' in 'app\node_modules\etag'
ERROR in ./node_modules/express/lib/view.js
Module not found: Error: Can't resolve 'fs' in 'app\node_modules\express\lib'
ERROR in ./node_modules/mime/mime.js
Module not found: Error: Can't …
Run Code Online (Sandbox Code Playgroud)

javascript npm express typescript electron

4
推荐指数
2
解决办法
7078
查看次数