Closed dingyiming closed 7 years ago
enableTypes
,但从 egg 的 bodyParse 中,没有配置该项,是否可以直接通过 enableTypes = ['json', 'form', 'txt']
实现?嗯,你在 config.default.js
里面配置一个 config.bodyParser
即可,会和默认的配置合并,并透传给 koajs/bodyparser
。
日志的那个在 #688 跟踪
好的,谢谢,添加了demo https://github.com/dingyiming/egg-demo, 发现其实是在进行一次请求后,再修改 controller/home.js 中 内容,就不会出现热加载了,后面再请求还是之前的内容,不过,还是发现有种时而好,时而不好的感觉,有点难捉摸
@dingyiming 本地无法复现,我们是用 egg-development 来做变更监控的,或者你本地跑下这个库的单测看看?
PS:你在用 vagrant 么?
我把这个 写在这里是不是不合适?
'use strict';
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 环境,
- 谢谢
leancloud 这块可以考虑写成一个插件。
你这段 init 应该放到 {app_root}/app.js
中
好,谢谢
重启问题 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.
我在 router.js 开头配置了 AV.init, 后发现,
npm run dev
开启开发调试时,修改文件的热重载失效,请问我该把leancloud 配置在什么地方,同时使开发热重载有效?然后在 controller 中 写 Leancloud 操作数据时,如果没有 加上 yield 会出现404 ,但没有明确说明原因,很无厘头的感觉,这块错误处理该怎么改善?
如何支持
Content-type = text/plain
请求的数据的解析? 在 Express 中的 bodyParse 比较方便的添加一下txt
的支持,自己再 JSON.parse()下 即可,这边不知道要怎么配置呢?也希望 egg的日志显示可以规整一些,简练些,最好像 thinkjs 配置成多彩的,好排查,
谢谢