Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

115
Views
Express render() doesn't work in post request

I am trying to do a redirect in a post request, but it doesn't work for me. Here is the express.js code that should do it:

app.set('view engine','ejs');
app.use("/",express.static('public'));

app.post("/sendMovieData", async(req,res)=>{
  console.log(req.body)
  res.render("../view/movie-selected")
})

And also here is the fetch request.

    let requestBody = {
        "movieName": movie.getAttribute("data-movieName"),
        "image": e.target.src,
        "city": JSON.parse(localStorage.getItem("city_country")).city,
        "country": JSON.parse(localStorage.getItem("city_country")).country
    }
    fetch('/sendMovieData', {
        method: "POST",
        headers: {
        'Content-Type': 'application/json;charset=utf-8'
        },
        body: JSON.stringify(requestBody)
    });   
about 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!