Home  >  Article  >  Database  >  node.js+mongodb+ejs+bootstrap练习CRUD做个简单的todolist

node.js+mongodb+ejs+bootstrap练习CRUD做个简单的todolist

WBOY
WBOYOriginal
2016-06-07 16:41:011333browse

源码地址:https://github.com/ivonlee/node.js-todolist 最近在学node.js,安装就不多介绍了,apt-get yum ?brew 先安装npm,其他的安装都可以用npm来安装 目录树 ivon@IvonMac ~/data/github/node.js-todolist$tree.|-- README.md|-- app.js|-- db.js|-- p

源码地址:https://github.com/ivonlee/node.js-todolist

最近在学node.js,安装就不多介绍了,apt-get yum ?brew 先安装npm,其他的安装都可以用npm来安装

目录树

ivon@IvonMac ~/data/github/node.js-todolist$tree
.
|-- README.md
|-- app.js
|-- db.js
|-- package.json
|-- public
|   `-- favicon.ico
|-- routes
|   `-- index.js
|-- utils.js
`-- views
    |-- edit.ejs
    |-- index.ejs
    `-- layout.ejs
3 directories, 11 files

node.js所需模块

"body-parser"     : "1.9.0",
"cookie-parser"   : "1.3.3", cookie认证
"express"         : "4.9.5", mvc web框架
"ejs"             : "1.0.0", ejs模板引擎
"errorhandler"    : "1.2.0", 错误
"method-override" : "2.2.0",
"ejs-locals"      : "1.0.2",ejs模板引擎
"mongoose"        : "3.8.17", mongodb orm
"morgan"          : "1.3.2", logger模块
"serve-favicon"   : "2.1.5", favicon ico
"serve-static"    : "1.6.3", 静态文件支持
"bootstrap"       : "3.3.0", 前端静态样式模板
"moment"          : "2.8.3", 时间模块,各种时间转换
"jquery"          : "2.1.1", 前端jquery库
"path"            : "0.4.9"  主要是有public 这样的静态目录

部署项目

git clone https://github.com/ivonlee/node.js-todolist.git
cd node.js-todolist
npm install
node app.js

效果

tododemo

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn