title: FeathersJs: Cannot set headers
body: <p>I am trying to set the content-type header on a route in a <a href="https://feathersjs.com/" rel="nofollow noreferrer">feathersjs</a> app. </p>
  
  <p>I keep running into this error - <code>error:  Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client</code></p>
  
  <p>This is how I am trying to set the headers --</p>
  
  <pre><code>const myService = {
    create(data, params) {   // create == POST request
      console.log(data);
      return Promise.resolve(); 
    }
  };
  
  function setContent(req, res, next) {
    res.setHeader('content-type', 'text/plain');
    res.end();
    next();
  }
  
  app.use('/incoming', myService, setContent);
  </code></pre>
  
  <p>I am guessing <code>return Promise.resolve();</code> also sets the header. How do i go about overriding that?</p>