jackhutu / jackblog-api-koa Goto Github PK
View Code? Open in Web Editor NEWJackblog API Server Koa 版, 个人博客系统, 基于RESTful架构, 使用Node.js, Koa, MongoDB, Redis, Token Auth, 七牛云存储等.
Home Page: https://jackhu.top
License: MIT License
Jackblog API Server Koa 版, 个人博客系统, 基于RESTful架构, 使用Node.js, Koa, MongoDB, Redis, Token Auth, 七牛云存储等.
Home Page: https://jackhu.top
License: MIT License
router.get('/getUserList', auth.hasRole('admin'),controller.getUserList)
router.post('/addUser', auth.hasRole('admin'),controller.addUser)
这是restful。。。
网站打不开了!
发现好像没有被其他地方require?
你好,最近在看你的项目,发现server/util/error/index.js下面对于err.errors的处理好像有点问题:
if(err.errors && typeof(err.errors) === 'object'){
_.mapValues(err.errors, (item)=>{
if(item.message){
error_msg = item.message //这里这样的处理可能有错误,error_msg只会保存最后一个message
}
})
}
是错误还是故意为之呢?
还有这个中间件如果是因为代码问题抛出的错误,并且没有对错误进行包装处理,是不是会直接把错误发送暴露给客户端呢?
$ gulp serve
[00:06:45] Using gulpfile E:\MyProject\bishe\boke\jackblog-api-koa\gulpfile.js
[00:06:45] Starting 'nodemon'...
[00:06:45] Finished 'nodemon' after 2.27 ms
[00:06:45] Starting 'serve'...
[00:06:45] Finished 'serve' after 7.8 μs
[00:06:45] [nodemon] 1.9.1
[00:06:45] [nodemon] to restart at any time, enter rs
[00:06:45] [nodemon] watching: E:\MyProject\bishe\boke\jackblog-api-koa\server/*/
[00:06:45] [nodemon] starting node --harmony server\app.js
module.js:327
throw err;
^
Error: Cannot find module '../build/Release/hcaptha.node'
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object. (E:\MyProject\bishe\boke\jackblog-api-koa\node_modules.npminstall\ccap\0.6.4\ccap\lib\hcap.js:4:13)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object. (E:\MyProject\bishe\boke\jackblog-api-koa\node_modules.npminstall\ccap\0.6.4\ccap\index.js:1:80)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
[00:06:46] [nodemon] app crashed - waiting for file changes before starting...
gulp serve
[09:26:36] Using gulpfile E:\zan\www\koa\jackblog-api-koa\gulpfile.js
[09:26:36] Starting 'nodemon'...
[09:26:36] Finished 'nodemon' after 2.96 ms
[09:26:36] Starting 'serve'...
[09:26:36] Finished 'serve' after 8.02 μs
[09:26:36] [nodemon] 1.8.1
[09:26:36] [nodemon] to restart at any time, enter rs
[09:26:36] [nodemon] watching: E:\zan\www\koa\jackblog-api-koa\server/*/
[09:26:36] [nodemon] starting node server\app.js
E:\zan\www\koa\jackblog-api-koa\server\config\seed.js:112
yield next;
^^^^^
SyntaxError: Unexpected strict mode reserved word
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:414:25)
at Object.Module._extensions..js (module.js:442:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:311:12)
at Module.require (module.js:366:17)
at require (module.js:385:17)
at Object. (E:\zan\www\koa\jackblog-api-koa\server\app.js:23:1
at Module._compile (module.js:435:26)
at Object.Module._extensions..js (module.js:442:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:311:12)
at Function.Module.runMain (module.js:467:10)
at startup (node.js:134:18)
at node.js:961:3
[09:26:37] [nodemon] app crashed - waiting for file changes before starting..
WARN tar ENOENT: no such file or directory, open '/Users/rachelhao/Desktop/jackblog-api-koa-master/node_modules/.staging/nyc-102709d8/node_modules/core-js/library/fn/symbol/has-instance.js'
WARN tar ENOENT: no such file or directory, open '/Users/rachelhao/Desktop/jackblog-api-koa-master/node_modules/.staging/nyc-102709d8/node_modules/core-js/library/fn/symbol/to-string-tag.js'
WARN tar ENOENT: no such file or directory, open '/Users/rachelhao/Desktop/jackblog-api-koa-master/node_modules/.staging/nyc-102709d8/node_modules/core-js/library/fn/symbol/for.js'
WARN tar ENOENT: no such file or directory, open '/Users/rachelhao/Desktop/jackblog-api-koa-master/node_modules/.staging/nyc-102709d8/node_modules/core-js/library/fn/symbol/unscopables.js'
WARN tar ENOENT: no such file or directory, open '/Users/rachelhao/Desktop/jackblog-api-koa-master/node_modules/.staging/nyc-102709d8/node_modules/core-js/library/fn/symbol/observable.js'
npm ERR! Unexpected end of JSON input while parsing near '...transpiler":"^5.6.1",'
使用token验证,session可以去掉的吧。
~$ sudo docker run -d -p 8800:7879 --name=blog jackhu/jenkins-deploy-nodejs:6 这样试了不行
建议添加详细安装说明吧,小白不太懂,
请问win本地测试为什么还要安装Python 2.7,Microsoft Visual Studio C++ 2013呢?
我测试其他nodejs程序都不需要安装这么多呀?
我自己申请了一个七牛云的账号,在运行您的上传图片的测试用例时发现上传成功了,但域名是七牛云分配的免费域名,是不是还要配置下镜像存储和绑定一下自己的域名,才能将存储后的路径图片路径通过这样:http://upload.jackhu.top/article/article/test.png 访问。
而且关于这点我还有点不明白的就是这样以来的话我是不是要在自己配置好的那个域名下保存一份,在七牛这边再保存一份呢
很喜欢你的程序,但要安装的东西太多了,小白好不容易都安装上了,结果cmd里还是大段的错误,能简化些吗? 使用门槛太高了呀
另外redis 有win32版本的
项目怎么下断点调试的啊,为什么我使用node-inspector 启动app.js,不能启动。。直接 node app.js就可以。
当安装koa-redis时,会要求安装hiredis,此时会抛出以下错误
[email protected] install E:\Study\前端\blog\jackblog\jackblog-api-koa\node_modules\hiredis
node-gyp rebuild
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
按要求安装Python后(装的是Python2.7版本),又会抛出C++相关的错误。
请问在windows下,是否有办法成功 install koa-redis ?
你网站的github登录一直提示登录失败
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.