angular2-webpack-starter如何将NodeJS服务器添加到项目中
我克隆了angular2-webpack-starter项目,效果很好; 现在我想添加一个单独的NodeJS服务器到这个项目(我需要嘲笑一些数据与NodeJS为后端),但不知道如何以及从哪里开始,有人可以帮忙吗?
这个问题已经解决了,只需要在config / webpack.dev.js中configurationdevServer的代理:
module.exports = { entry:{...}, ... devServer: { host: 'localhost', port: 8086, //frontend port historyApiFallback: true, noInfo: true, watchOptions: { aggregateTimeout: 300, poll: 100 }, outputPath: '/', proxy: { '/api/*': { //backend url prefix, some thing like '/api/users/:userId' target: 'http://localhost:3000', // backend host and port secure: false } } } };
- PassportJS – 在将有效载荷数据传递给passport.authenticate作为请求参数之前获取
- 如何将会话variables从express / node传递给angular?
- Node.js + Angular = Uncaught ReferenceError:require没有被定义
- 如何使用Angular前端和Node后端以及从OAuth开始的Git中心API创buildWeb应用程序?
- 在客户端使用AngularJS进行HTTP请求
- dynamic页面标题使用MEAN堆栈 – Jade和Angular
- AngularJS – 处理手动input的URL的最佳方式
- 鲍尔 – EPERM,取消链接错误
- 服务器端为node.js模板化