title: Redirecting after fetch post in node.js with express
body: <p>I have ejs page(/profile/addcalender) and I am taking data from that page by using fetch with post. I can take and process data in my serverside post method but ı can not redirect after it.</p>
  
  <p>Here is the related part of the ejs page:</p>
  
  <pre><code>&lt;li&gt;&lt;button class="contact100"  id='nextstp' style="width: 100%; height: 100px; font-size: larger; padding-bottom: 0px;"&gt; &lt;span&gt;SCHEDULE&lt;/span&gt;&lt;/button&gt;&lt;/li&gt;
  </code></pre>
  
  <p>This is the related part of .js file connected to ejs to take data and where I use fetch:</p>
  
  <pre><code>function moveon(){  //Collecting data in here // Bu fonksiyon da dataları toplaman lazım !!
   var mailler = mails; // ALL mails
   var Title = document.getElementById("title").value; // Meeting Title
   var desc = document.getElementById("description").value; // Meeting Description
  
   if(!Title){alert("Cannot Submit without title"); return;}
   if(!desc){alert("Description is mandatory"); return;}
   if(mails.length &lt; 1){alert("You need AT LEAST one attendee"); return;}
  
   var stuff = {title: Title, decription: desc, mails:mailler}
   console.log(stuff);
   console.log(JSON.stringify(stuff));
  
   var stuff2 = {title : "alex", description: "de souza"};
   options = {
     method : 'POST',
     redirect: 'follow',
     body: JSON.stringify(stuff),
     headers: {
       'Content-Type': 'application/json'
     }
   };
  
   fetch('/profile/addcalender', options);
  
  }
  </code></pre>
  
  <p>Here is the where I take post request with express:</p>
  
  <pre><code>  router.get('/addcalender', (req,res) =&gt; {
    //console.log(req.user);
  
     res.render('calendermeet',{user:req.user});
    })
  
    router.post('/addcalender', userController.postCalenderMeet);
  </code></pre>
  
  <p>Here is where I process data in server-side in usercontroller:</p>
  
  <pre><code>module.exports.postCalenderMeet = (req, res, next) =&gt; {
  console.log("POST CALENDAR MEEEET")
  
  async function main() {
  
      var userCalendars = [];
  
      for (email of req.body.mails) {
          await User.findOne({
              email: email
          }).then(user =&gt; {
              if (user) {
                  //console.log(user.name);
                  //console.log(user.calender);
                  userCalendars.push(user.calender)
              }
          }).catch(err =&gt; console.log(err));
      }
  
      userCalendars.push(req.user.calender);
  
      console.log("1");
      console.log(userCalendars);
      console.log("2");
  
      res.redirect("/profile/calender");
  
      return userCalendars;
  
    }
  
    main();
  
  
  
   };
  </code></pre>
  
  <p>In normally I take post requests from form and at the server-side redirecting works. But when I used fetch it does not redirecting and I am staying on the same page.</p>