如果输入了无效路径,有没有办法配置Angular2路由器重定向到特定路由?
例如,如果我有三条路线:
/ home
/ about
/ 404
我输入/训练(路线,路线配置中不存在),我希望路由器将我重定向到404.
我想在电子应用程序中公开 REST 服务,并且我想将 expressJS 与电子一起使用,如教程所述,我添加了 express 和 @types/express。我试图公开一个“get”,但是当我构建并运行它时会抛出以下内容。
跑着 ng build --prod
Run Code Online (Sandbox Code Playgroud)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 …