Are you first timer at lazacode.org? Why not join us and start exchange your programming knowledge with everyone. Register today!

react - 404 dynamic URL - on string API URL issue

0 votes
31 views
added Mar 10 in React by lcjr First Warrant Officer (8,030 points)
// Fixt it at /root/server.js

// Add the following line
  server.get('/new-category/:type/:cat', (req, res) => {
    const actualPage = '/new-category-component';
    const queryParams = req.query;  
    app.render(req, res, actualPage, queryParams);  
  });
  server.get('/all-categories/:type', (req, res) => {
    const actualPage = '/all-categories-component';
    const queryParams = req.query;  
    app.render(req, res, actualPage, queryParams);  
  });

 

Please log in or register to response this reference.

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...