大佬教程收集整理的这篇文章主要介绍了angularjs – Grunt Connect代理:404未找到,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:9000/api/users@H_772_1@我的代理配置:
connect: { options: { port: 9000,// Change this to '0.0.0.0' to access the server from outside. hostname: 'localhost',livereload: 35729 },proxies: [{ context: '/api',// the context of the data service host: 'localhost',// wherever the data service is running port: 8080,// the port that the data service is running on https: false,xforWARD: false }],@H_772_1@我的中间件:
livereload: { options: { open: true,base: '',middleware: function (connect,options) { var middlewares = []; middlewares.push(require('grunt-connect-proxy/lib/utils').proxyrequest); middlewares.push(connect.static('.tmp')); middlewares.push(connect.static('test')); middlewares.push(connect().use( '/bower_components',connect.static('./bower_components') )); middlewares.push(connect.static(appConfig.app)); return middlewares; } } },@H_772_1@我的服务任务
grunt.registerTask('serve','Compile then start a connect web server',function (target) { if (target === 'dist') { return grunt.task.run(['build','connect:dist:keepalive']); } grunt.task.run([ 'clean:server','wiredep','concurrent:server','autoprefixer:server','configureProxies:server','connect:livereload','watch' ]); });@H_772_1@编辑
以上是大佬教程为你收集整理的angularjs – Grunt Connect代理:404未找到全部内容,希望文章能够帮你解决angularjs – Grunt Connect代理:404未找到所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。