eggjs / egg

🥚 Born to build better enterprise frameworks and apps with Node.js & Koa
https://eggjs.org
MIT License
18.88k stars 1.81k forks source link

请问leancloud-storage应该配置在什么地方? #687

Closed dingyiming closed 7 years ago

dingyiming commented 7 years ago
atian25 commented 7 years ago
dingyiming commented 7 years ago

image

image

atian25 commented 7 years ago

嗯,你在 config.default.js 里面配置一个 config.bodyParser 即可,会和默认的配置合并,并透传给 koajs/bodyparser

日志的那个在 #688 跟踪

dingyiming commented 7 years ago

好的,谢谢,添加了demo https://github.com/dingyiming/egg-demo, 发现其实是在进行一次请求后,再修改 controller/home.js 中 内容,就不会出现热加载了,后面再请求还是之前的内容,不过,还是发现有种时而好,时而不好的感觉,有点难捉摸

atian25 commented 7 years ago

image

@dingyiming 本地无法复现,我们是用 egg-development 来做变更监控的,或者你本地跑下这个库的单测看看?

PS:你在用 vagrant 么?

dingyiming commented 7 years ago

我把这个 写在这里是不是不合适?

const AV = require('leancloud-storage'); const appId = 'Hu3riuJhm1BopDbH2DGe472U-gzGzoHsz'; const appKey = 'weBjsqduBxOrmcno0RgnsfJG'; AV.init({ appId, appKey });

module.exports = app => { app.get('/', 'home.index'); };



- 哦哦,好的,我试试,没有再用vagrant ,是 windows 环境,
- 谢谢
atian25 commented 7 years ago

leancloud 这块可以考虑写成一个插件。

你这段 init 应该放到 {app_root}/app.js

dingyiming commented 7 years ago

好,谢谢

atian25 commented 7 years ago

重启问题 OK 了?

发自我的 iPhone

在 2017年3月30日,12:15,丁一 notifications@github.com 写道:

Closed #687.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.