xuebaoxin #33

Manually merged
theluyuan merged 3 commits from xuebaoxin into master 2019-12-06 11:40:06 +08:00
2 changed files with 4 additions and 4 deletions

View File

@ -1,5 +1,5 @@
# blog-server
####目录结构
#### 目录结构
- bin 基础文件存放
~~~
mongobd.js 链接mongodb基础 和 对于mongodb操作封装

View File

@ -6,11 +6,11 @@ function addMapping(router, mapping) {
if (url.startsWith('GET ')) {
var path = url.substring(4);
router.get(path, mapping[url]);
console.log(`register URL mapping: GET ${path}`);
// console.log(`register URL mapping: GET ${path}`);
} else if (url.startsWith('POST ')) {
var path = url.substring(5);
router.post(path, mapping[url]);
console.log(`register URL mapping: POST ${path}`);
// console.log(`register URL mapping: POST ${path}`);
} else {
console.log(`invalid URL: ${url}`);
}
@ -32,7 +32,7 @@ function addControllers(router, controllers_dir) {
});
for (var f of js_files) {
console.log(`process controller: ${f}...`);
// console.log(`process controller: ${f}...`);
let mapping = require(dir + `/${controllers_dir}/` + f);
addMapping(router, mapping);
}