0
我为API开发设置了symfony 3 apache 2.4和mysql环境...我刚开始并且index.html.twig页面出现像这样:如何将内容类型:应用程序/ json转换为响应头中的html
我config.yml已FOSRest配置为JSON格式而不是HTML:
# FOSRest Configuration
fos_rest:
body_listener: true
format_listener:
rules:
- { path: '^/', priorities: ['json'], fallback_format: json, prefer_extension: false }
param_fetcher_listener: true
view:
view_response_listener: 'force'
formats:
json: true
# Nelmio CORS Configuration
nelmio_cors:
defaults:
allow_credentials: false
allow_origin: ['*']
allow_headers: ['*']
allow_methods: ['GET', 'POST', 'PUT', 'DELETE', 'OPTIONS']
max_age: 3600
hosts: []
origin_regex: false
我的问题:如何才能让我的网页渲染作为HTML?
只是为了笑着尝试改变路径:“^ /”到路径:“^/API” – Cerad