简体   繁体   中英

Express routes not working?

I have just started a brand new Express app following the Code Magazine's tutorial .

Here's my app and the /img route definitions. 路线

When I browse to http://localhost:3000/img or http://localhost:3000/img/ , I gets a 404 Not Found response.

What am I missing?

You are mounting your /img route on /img . That is to say, you would need to GET /img/img to hit your route. Replace /img with / in your img.js file.

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