title: webpack dev server proxy post requests to local .json file
body: <p>I have a new project in hand, so I don't have any server-side support, they are not ready yet.</p>
  
  <p>I want to mock my http requests with local json files.</p>
  
  <p>I have two requests on-going:</p>
  
  <ol>
  <li><p>/entity/get  method is 'GET'</p></li>
  <li><p>/entity/create  method is 'POST'</p></li>
  </ol>
  
  <p>And I have two local json files</p>
  
  <ol>
  <li><p>mock/entity/get.json</p></li>
  <li><p>mock/entity/create.json</p></li>
  </ol>
  
  <p>In my config file:</p>
  
  <p>config/index.js:</p>
  
  <p>proxyTable: {</p>
  
  <pre><code>'/entity':{
  
      target: 'http://localhost:8080/mock/',
  
      pathRewrite(path) {
  
          return url.parse(path).pathname + '.json';
  
      }
  
  }
  </code></pre>
  
  <p>}</p>
  
  <p>build/dev-server.js</p>
  
  <p>app.use('/mock', express.static('mock'));</p>
  
  <p>Results:</p>
  
  <ol>
  <li><p>/entity/get, I get what I want.</p></li>
  <li><p>/entity/create, 404</p></li>
  </ol>
  
  <p>My question:</p>
  
  <ol>
  <li><p>Why cannot I get create.json responsed by the express server?</p></li>
  <li><p>In webpack1.0  I had same question, but I handled the question by turning all post request to get request, the side effect is, I lost all request params during the post-to-get transition. I can live with it but in webpack 2.0 I even don't kown how to config like that.</p></li>
  </ol>