title: only on Phone. Error: Failed to lookup view "error" in views directory
body: <p>Hello everyone I know this issue exists several times but I looked all of them but couldn't find any solution.I have an ionic app and works all functions however only change profile picture post gives that error on server.</p>
  
  <p><strong>Client</strong></p>
  
  <pre><code>ChangeTheProfilePicture() {
  this.camera.getPicture(this.options).then((imageData) =&gt; {
  
    this.imageURL = 'data:image/jpeg;base64,' + imageData;
    var data = {
      img: this.imageURL
    }
    this.http.post('http://myIpAdress:3100/api/addProfilePic', data)
      .subscribe((data1: any) =&gt; {
        console.log("done: ", data1);
      }, err =&gt; {
        console.log("photo err: ", err);
      })
  })}
  </code></pre>
  
  <p><strong>Server</strong></p>
  
  <pre><code>  app.use(function (req, res, next) {
    res.header("Access-Control-Allow-Origin", "*");
    res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE,OPTIONS');
    res.header("Access-Control-Allow-Headers", "X-Requested-With,Content-
    Type,Cache-Control");
    if (req.method === 'OPTIONS') {
      res.statusCode = 204;
  
      return res.end();
    }
    else {
      return next();
    }
    });
  app.use(function (req, res, next) {
  var err = new Error('Not Found');
  err.status = 404;
  next();
  });
  
  // error handlers
  
  if (app.get('env') === 'development') {
  app.use(function (err, req, res, next) {
      res.status(err.status || 500);
      res.render('error', {
          message: err.message,
          error: err
      });
  });
  }
  
  //View Engine
  app.set('views', path.join(__dirname, 'views'));
  app.set('view engine', 'ejs');
  app.engine('html', require('ejs').renderFile);
  
  
  //set static folder
  app.use(express.static(path.join(__dirname, 'client')));
  </code></pre>
  
  <p>When  I take a photo on my phone then press okay button the server side gives an error(it can't even go the routes to get that postapi/addProfilePic).I guess my client side true but in server side setting views folder is wrong.</p>
  
  <p><strong>File root</strong></p>
  
  <p><a href="https://i.stack.imgur.com/vNeII.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vNeII.png" alt="enter image description here"></a></p>
  
  <p>Thank you</p>