Tag: grunt connect

如何解决Gruntfile.js中错误configuration的grunt-connect-proxy设置的404错误?

背景: 我正在尝试将我的grunt服务器实例连接到在localhost上运行在同一台机器上的API服务:8080 / api /。 目前使用grunt-connect-proxy来实现这一点。 问题/问题: http://localhost:9000/api/user-profile/ Failed to load resource: the server responded with a status of 404 (Not Found) 我的configuration(下面)是否有一个错误,防止/api请求redirect到localhost:8080的代理服务器? 我的设置(Gruntfile.js): var proxySnippet = require('grunt-connect-proxy/lib/utils').proxyRequest; … // Grunt configuration grunt.initConfig({ // Project settings someApp: appConfig, // The grunt server settings connect: { options: { port: 9000, hostname: 'localhost', livereload: 35729 }, server: […]