1 Star 0 Fork 7

Admin / express-ejs-mongoose-nodejs

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

express-ejs-mongoose-nodejs

特性说明

  • 实现了登陆
  • 实现了注册
  • 使用了mongoose
  • 使用了express-session做权限控制
  • 前端使用bootstrap
  • 实现了两种权限控制
    • session权限控制
    • 通过公钥、私钥进行身份认证
  • 公钥、私钥身份认证
    • 通过node-rsa类库产生公钥、私钥
    • 客户端持有私钥,通过对发送数据进行私钥加密,传递给服务端
    • 服务端通过公钥进行身份认证,如果通过则提供服务,不通过则拒绝
    • 通过这种方式可以设计系统的开发API
  • 实现了两种请求转发方式
    • 前端请求转发到nodejs后端,nodejs可以再次转发前后返回到前端,参考:

app.use('/reqforword',reqforword);对应的功能

+ 前端请求直接通过nodejs转发的第三方,直接返回结果,参考:

app.use('/remoteReq',function(req,res){ var url = "http://localhost:8082/dev/student/all?id=ComeOnparaid"; req.pipe(request.post(url,{form:req.body})).pipe(res); });

运行方式

修改配置文件

根据mongodb运行环境修改config.js

  • 数据存放db

exports.dburl = 'mongodb://127.0.0.1/cmsdata';

  • session存放db

exports.dbsession = 'mongodb://localhost/sessiondb';

  • 启动mongodb

下载mongo_data.zip,解压缩,启动mongo指向此数据文件

  • 启动应用

npm install npm start

  • 访问

http://localhost:3100

  • 默认用户 admin/admin
MIT License Copyright (c) 2016 jameschuh Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

nodejs project with mongoose. 展开 收起
NodeJS
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
NodeJS
1
https://gitee.com/isni_admin/express-ejs-mongoose-nodejs.git
git@gitee.com:isni_admin/express-ejs-mongoose-nodejs.git
isni_admin
express-ejs-mongoose-nodejs
express-ejs-mongoose-nodejs
master

搜索帮助