node.js跨坑技巧

关于nodejs+MongoDB实现注册登录的补充

2019-06-10  本文已影响0人  _踮起脚尖看世界

原作者链接:https://www.jianshu.com/p/b9a8a89f6c9f
由于文章内容没有页面部分的说明,导致运行后出现404错误,解决方法:
在public下增加页面部分

图片.png
login/index.html
<!DOCTYPE html>
<html>
<head lang="en">
  <meta charset="UTF-8">
  <title></title>
</head>
<body>
<form method="post">
  <div>
    name: <input type="text" id="name" name="name"/>
  </div>
  <div>
    pwd: <input type="text" id="pwd" name="pwd"/>
  </div>
  <div>
    mobile: <input type="text" id="mobile" name="mobile"/>
  </div>
  <input type="submit" value="提交"/>
</form>
</body>
</html>

register/index.html

<!DOCTYPE html>
<html>
<head lang="en">
  <meta charset="UTF-8">
  <title></title>
</head>
<body>
<form method="post">
  <div>
    name: <input type="text" id="name" name="name"/>
  </div>
  <div>
    pwd: <input type="text" id="pwd" name="pwd"/>
  </div>
  <div>
    mobile: <input type="text" id="mobile" name="mobile"/>
  </div>
  <button type="submit">提交</button>
</form>
</body>
</html>

GitHub地址:https://github.com/2019997204/nodejs-mongodb

上一篇 下一篇

猜你喜欢

热点阅读