├── test ├── promise.js ├── tmp ├── index.js ├── ejs │ ├── test.ejs │ └── index.js ├── cookie │ ├── session-cookie.js │ ├── permanent-cookie.js │ ├── index.js │ └── secure_httpOnly-cookie.js ├── mongoose │ ├── index.js │ ├── _index.js │ ├── base.js │ ├── model.js │ └── schema.js ├── http.js ├── css_responsive │ └── index.html └── buffer.js ├── public ├── js │ ├── index │ │ └── index.js │ ├── about │ │ ├── scss │ │ │ └── index.scss │ │ ├── ajax.js │ │ └── index.js │ ├── manage │ │ ├── ajax │ │ │ ├── index.js │ │ │ ├── category.js │ │ │ └── blog.js │ │ ├── util.js │ │ ├── scss │ │ │ └── index.scss │ │ ├── components │ │ │ ├── Dialog.js │ │ │ ├── menu.js │ │ │ ├── write.js │ │ │ ├── category.js │ │ │ └── manage.js │ │ └── index.js │ ├── components │ │ ├── index.js │ │ ├── detail │ │ │ ├── index.scss │ │ │ ├── responsive.scss │ │ │ ├── markdown.scss │ │ │ └── index.js │ │ ├── write │ │ │ ├── ajax.js │ │ │ └── index.js │ │ └── dialog │ │ │ └── index.js │ ├── list │ │ ├── scss │ │ │ └── index.scss │ │ └── index.js │ ├── common │ │ └── index.js │ └── detail │ │ ├── scss │ │ └── index.scss │ │ └── index.js ├── .gitignore ├── dist │ ├── about.css.map │ ├── detail.css.map │ ├── index.js.map │ ├── list.css.map │ ├── manage.css.map │ ├── index.js │ ├── about.css │ ├── detail.css │ ├── manage.css │ └── list.css ├── img │ ├── zhihu.jpeg │ ├── avatar.jpeg │ └── github.jpeg ├── .babelrc ├── build │ ├── alias.js │ ├── webpack.config.js │ └── plugin_loader.js ├── README.md ├── css │ ├── highlight │ │ ├── solarized-dark.scss │ │ ├── dark.scss │ │ └── light.scss │ ├── header_footer │ │ └── index.scss │ └── reset.scss └── package.json ├── .gitignore ├── db.sh ├── doc ├── 2nd-assets │ └── path.png ├── 3rd-assets │ └── url.png ├── 8th_responsive_css │ └── media.md ├── 10th_router_mongo.md ├── 8th_cookie_session │ ├── cookie_headers.md │ └── knowledge.md ├── 9th_mongodb.md ├── 8th_cookie_session.md ├── 6th_ejs.md ├── 12th_react_antd.md ├── 3rd_promise.md ├── 7th_router_css.md ├── 11th_ajax_mongo.md ├── 4th_stream.md ├── 5th_buffer.md ├── 2nd_http_posix.md ├── 1st_npm_node_module_http.md └── 13th_deploy.md ├── app ├── view-server │ ├── ejs │ │ ├── layout.ejs │ │ └── module │ │ │ ├── footer.ejs │ │ │ └── header.ejs │ ├── urlrewrite.js │ └── index.js ├── api │ ├── index.js │ ├── mongo │ │ ├── schema.js │ │ └── index.js │ ├── router │ │ └── index.js │ └── ajax.js ├── cookie-parser │ └── index.js ├── staic-server │ └── index.js ├── url-parser │ └── index.js └── index.js ├── index.js ├── package.json └── README.md /test/promise.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/js/index/index.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | 3 | -------------------------------------------------------------------------------- /public/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | 3 | -------------------------------------------------------------------------------- /db.sh: -------------------------------------------------------------------------------- 1 | # !/bin/sh 2 | 3 | 4 | mongod --dbpath ~/data/db 5 | -------------------------------------------------------------------------------- /public/js/about/scss/index.scss: -------------------------------------------------------------------------------- 1 | @import "../../detail/scss/index.scss" -------------------------------------------------------------------------------- /public/js/manage/ajax/index.js: -------------------------------------------------------------------------------- 1 | export * from './blog' 2 | export * from './category' -------------------------------------------------------------------------------- /public/dist/about.css.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":[],"names":[],"mappings":"","file":"about.css","sourceRoot":""} -------------------------------------------------------------------------------- /public/dist/detail.css.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":[],"names":[],"mappings":"","file":"detail.css","sourceRoot":""} -------------------------------------------------------------------------------- /public/dist/index.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js","sourceRoot":""} -------------------------------------------------------------------------------- /public/dist/list.css.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":[],"names":[],"mappings":"","file":"list.css","sourceRoot":""} -------------------------------------------------------------------------------- /public/dist/manage.css.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":[],"names":[],"mappings":"","file":"manage.css","sourceRoot":""} -------------------------------------------------------------------------------- /public/img/zhihu.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slashhuang/pure-node-notebook-step/HEAD/public/img/zhihu.jpeg -------------------------------------------------------------------------------- /doc/2nd-assets/path.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slashhuang/pure-node-notebook-step/HEAD/doc/2nd-assets/path.png -------------------------------------------------------------------------------- /doc/3rd-assets/url.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slashhuang/pure-node-notebook-step/HEAD/doc/3rd-assets/url.png -------------------------------------------------------------------------------- /public/img/avatar.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slashhuang/pure-node-notebook-step/HEAD/public/img/avatar.jpeg -------------------------------------------------------------------------------- /public/img/github.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slashhuang/pure-node-notebook-step/HEAD/public/img/github.jpeg -------------------------------------------------------------------------------- /public/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | "es2015", 4 | "react", 5 | "stage-0" 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /public/js/components/index.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | export DetailPanel from './detail/' 5 | export BlogWritePanel from './write/' -------------------------------------------------------------------------------- /test/tmp: -------------------------------------------------------------------------------- 1 | 床前明月光疑是地上霜 2 | 举头望明月低头思故乡 3 | 床前明月光疑是地上霜 4 | 举头望明月低头思故乡 5 | 床前明月光疑是地上霜 6 | 举头望明月低头思故乡 7 | 床前明月光疑是地上霜 8 | 举头望明月低头思故乡 9 | 床前明月光疑是地上霜 10 | 举头望明月低头思故乡 -------------------------------------------------------------------------------- /test/index.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | // require('./buffer') 6 | // require('./http') 7 | 8 | // require('./ejs') 9 | 10 | // require('./cookie'); 11 | 12 | require('./mongoose/'); -------------------------------------------------------------------------------- /test/ejs/test.ejs: -------------------------------------------------------------------------------- 1 | 床前明月光疑是地上霜 2 | 举头望明月低头思故乡 3 | 床前明月光疑是地上霜 4 | 举头望明月低头思故乡 5 | 床前明月光疑是地上霜 6 | 举头望明月低头思故乡 7 | 床前明月光疑是地上霜 8 | 举头望明月低头思故乡 9 | 床前明月光疑是地上霜 10 | 举头望明月低头思故乡 11 | <%-world %> -------------------------------------------------------------------------------- /public/js/manage/util.js: -------------------------------------------------------------------------------- 1 | /* 2 | * 管理后台工具类 3 | */ 4 | 5 | import querystring from 'querystring' 6 | let query = querystring.parse(location.search.substr(1)) 7 | 8 | export { 9 | query 10 | } -------------------------------------------------------------------------------- /public/build/alias.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by slashhuang on 17/4/5. 3 | * alias模块 4 | */ 5 | 6 | module.exports = { 7 | reset:'css/reset.scss', 8 | common_lib:'js/common/index.js', 9 | highlight:"highlight" 10 | }; -------------------------------------------------------------------------------- /public/dist/index.js: -------------------------------------------------------------------------------- 1 | webpackJsonp([4],{ 2 | 3 | /***/ 1413: 4 | /***/ (function(module, exports, __webpack_require__) { 5 | 6 | "use strict"; 7 | 8 | 9 | /***/ }) 10 | 11 | },[1413]); 12 | //# sourceMappingURL=index.js.map -------------------------------------------------------------------------------- /test/cookie/session-cookie.js: -------------------------------------------------------------------------------- 1 | /* 2 | * 学习sesssion cookie 3 | */ 4 | 5 | //在chrome里面,必须将浏览器完全关闭session cookie才生效 6 | module.exports =(request,response)=>{ 7 | let sessionCookie = `userId=node;` 8 | response.setHeader('Set-Cookie',sessionCookie); 9 | return request.headers 10 | } -------------------------------------------------------------------------------- /public/js/about/ajax.js: -------------------------------------------------------------------------------- 1 | //网络请求 2 | import axios from 'axios'; 3 | //url形式 localhost:7000/blog?id=111 4 | export const blogAboutApi = (query)=>{ 5 | let api = '/blogDetail.action'//?id=about' 6 | return axios.get(api,query).then((res)=>{ 7 | return res['data'] 8 | }) 9 | }; -------------------------------------------------------------------------------- /app/view-server/ejs/layout.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | <%- include('./module/header') %> 8 |