beego:Handler crashed with error can‘t find template file in the path的问题解决

问题提示:

在用beego框架写apiserver的时候遇到了, Handler crashed with error can't find templatefile in the path  views/***/***.tpl的报错,

搜索发现是beego默认打开了使用示图输出模版,可是我只用beego写API接口,并不需要一些模版渲染,这个时候关闭默认模板即可

解决方式:

配置文件里添加:

autorender = false

autorender = false

可以在main.go文件里关闭

beego.AutoRender = false

猜你喜欢

转载自blog.csdn.net/u011285281/article/details/129691181