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

194
Views
Can an <a> tag send a GET request?

I'm building a website in Node.js, Express, and EJS. In the past, I have created forms where the button is of type="submit". I would then have my index.js file do a res.render to pull up the ejs file I'm trying to route to.

Right now, I'm trying to route from an <a> tag to an ejs file called "/jsonData".

I've added the GET request in my index.js file:

app.get('/jsonData', (req, res) => {
    res.render('jsonData');
});

and I've added the a tag in my home.ejs file:

<li class="nav-item">
   <a class="nav-link" href="/jsonData">JSON Data</a>
</li>

My jsonData file is in my views folder because I set app.set('view engine', 'ejs'); earlier in the index.js file.

My home.ejs file runs great when I start the server using node index.js, but when I click on the link to go to my jsonData page, I get the error: Cannot GET /jsonData

I'm sure I'm probably doing something obviously wrong but I don't know what to do.

Thank you in advance!!

about 4 years ago · Juan Pablo Isaza
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!