nodejs路由奇怪的行为

时间:2015-10-09 13:44:47

标签: javascript node.js

我有一个视图调用register.jade

extend layout

block content
    h1 Register
    p Please register using the form below
    form(method='post',action='users/register',enctype='multiple/form-data')
        .form-group
            label Name
            input.form-control(name='name',type='text',placeholder='name')
        .form-group
            label Email
            input.form-control(name='email',type='text',placeholder='Enter Email')
        .form-group
            label Username
            input.form-control(name='username',type='text',placeholder='Usernama')
        .form-group
            label Password
            input.form-control(name='password',type='text',placeholder='Enter Password')
        .form-group
            label Confirm Password
            input.form-control(name='password2',type='text',placeholder='Confirm Password')
        .form-group
            label Profile Image
            input.form-control(name='profileimage',type='file')
        input.btn.btn-default(name='submit',type='submit',value='Register')

当我点击提交时,它会转到 http://localhost:3000/users/users/register并且说没找到。

为什么会这样?在我的user.js中我有这个

router.get('/register', function(req, res, next) {
  res.render('register',{
    'title':'Register'
  });
});

router.post('/register',function(req,res,next){

});

0 个答案:

没有答案