-
比如
this.json({}) 输出是一个object
如何输出一个字符串就像 this.string('hello thinkjs')
虽然这样子看起来很不规范
ThinkJS Version:2.2.x
-
![image](https://user-images.githubusercontent.com/12272166/28619299-3cacf1a8-723a-11e7-8a5a-d4c7afea2111.png)
-
如果我修改了bootstrap里面的文件,这个时候运行 npm start 那么这么这里面的文件会执行两次.
感觉thinkjs的逻辑好像是 先运行,如果监测到文件有变化在重新执行。如果这样子执行的话那么很多前期的准备的工作就会执行两遍。
```bash
npm run compile && npm start
```
是不是应该这么处理
但是我觉得运行执行了多次应该通知…
-
## DESC
我依照官網的說明做測試,發現如果crontab.js
有修改內容,之前的定时任务會一直存在
多改幾次crontab.js就會有多個任务
請問這樣算是正常?
## ENV
Platform:
Node.js Version:
ThinkJS Version:
-
很多时候我们只需要写一个简单的App应用,不需要Web服务和监听一个端口。但是很多时候依赖一些基础性的东西,如数据库、配置文件等,但这些其实是可以封装成一个类似java里的spring框架那样只用来创建一个普通的App应用。
arden updated
7 years ago
-
I know the version 3 beta has the enableDefaultRoute parameter. But how can I do this for version 2?
萬分感謝
-
## DESC
## ENV
Platform:
Node.js Version:
ThinkJS Version:
-
## DESC
想试试用thinkjs3.*做服务器渲染的,下面控制器里面不小心用import引入文件:
```js
const Base = require('./base.js');
var React = require('react');
var renderToString = require('react-dom/server');
var StaticRouter = r…
51kad updated
7 years ago
-
## DESC
现在 thinkjs 里面访问路由不支持大写,比如(cityAPI/getCityList)这样,可以命中 cityAPI
控制器 下的 getCityList Action ,这个 应该怎么配置呢?
## ENV
Platform:
Node.js Version:
ThinkJS Version:
-
## DESC
不知道有没有这个功能,我想使用 `controller` 中的 `__after()` 方法拦截 `action` 的结果,并在错误的时候记录日志,并记录方法名称。
如果正常写,我需要在每个 **action** 的最后都加上日志语句,破坏程序结构,而且不美观。
现在的做法是:
> 在 `__before()` 中获取当前 **action** 的名字,并设置到 `this…