Elixir 如何在Phoenix框架中关闭开发错误消息?

Elixir 如何在Phoenix框架中关闭开发错误消息?,elixir,phoenix-framework,Elixir,Phoenix Framework,现在我从我的Phoenix服务器收到了很好的错误消息: 但是,我使用Phoenix作为API,这些错误消息显示为大量不可读的html: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>UndefinedFunctionError at GET /api/v1/sessions/test</title> <meta name

现在我从我的Phoenix服务器收到了很好的错误消息:

但是,我使用Phoenix作为API,这些错误消息显示为大量不可读的html:

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>UndefinedFunctionError at GET /api/v1/sessions/test</title>
    <meta name="viewport" content="width=device-width">
    <style>/*! normalize.css v4.2.0 | MIT License | github.com/necolas/normalize.css */html{font
      ...1300+ lines...

GET/api/v1/sessions/test处的UndefinedFunctionError
/*! normalize.css v4.2.0 | MIT License | github.com/necolas/normalize.css*/html{font
…1300多条线路。。。

有没有办法关闭此功能,以便我的开发服务器可以显示JSON错误消息?谢谢。

在web端点配置主部分的
config/dev.exs
中,将
debug\u errors
值设置为
false

config:my_app,MyAppWeb.Endpoint,
#http:[端口:4000]、#或类似
调试_错误:false,#⇐ 在这里
...