gpt4 book ai didi

api - Symfony2 FosRestBundle 根 api url

转载 作者:行者123 更新时间:2023-12-04 16:59:20 24 4
gpt4 key购买 nike

我一直在查看 FOS-Rest-Bundle 文档以开发我的 API。问题是我希望 API 位于 api/下,并且似乎没有任何选项可以实现这一点。

有办法吗?我该怎么做?

谢谢

最佳答案

您可以在路由中添加前缀。
http://symfony.com/doc/current/book/routing.html#prefixing-imported-routes

例如 :

api_rest:
type: rest
prefix: /api
resource: "@MyBundle/Resources/config/rest_routes.yml"

关于api - Symfony2 FosRestBundle 根 api url,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28956233/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com