简体   繁体   中英

router works on localhost but not in production in node.js

I am using express.js framework and the router seems to work in local but not in production

router.route(`/server/template/:id`)
  .delete(test.delete)
  .get(temp.get);


router.route(`/server/template`)
  .post(test.post)
  .get(test.get);

I get the below error message:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>404 Not Found</title>
<h1>Not Found</h1>
<p>The requested URL was not found on the server.  If you entered the URL manually please check your spelling and try again.</p>

您需要使用Apache Web服务器在您自己的计算机或Internet上,或者在apache朋友,XAMPP或IIS中模拟HTML服务器。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM