search

Home  >  Q&A  >  body text

Beginners encounter problems with express when learning node.js

//index.js
var express=require('express');
var app=express();
app.get('/',function(req,res){
    res.send('hello express');
});
app.get('/user/:name',function(req,res){
    res.send('hello '+req.params.name);
});
app.listen(3000);

Why does the page display 'Cannot GET /users/fabrice' when accessing 'localhost:3000/users/fabrice'
Please let me know, thanks ~~

怪我咯怪我咯2752 days ago382

reply all(2)I'll reply

  • 大家讲道理

    大家讲道理2017-05-16 13:44:20

    You wrote an extra s

    reply
    0
  • 阿神

    阿神2017-05-16 13:44:20

    Your route is configured with user, but the access is users←_←

    reply
    0
  • Cancelreply