A.Seddighi
A.Seddighi

Reputation: 1765

routing in symfony 4

I want to routing for my app and api like this:

app:
    resource: ../src/Controller
    type: annotation
    prefix: /

api:
    resource: ../src/Controller/Api
    type: annotation
    prefix: /api

Q1: Where should I write this? in config/routes/annotations.yaml or config/routes.yaml.

Q2: what is different between this two file and which one is used for?

Upvotes: 1

Views: 617

Answers (1)

Tomsgu
Tomsgu

Reputation: 1016

The file config/routes/annotations.yaml was probably created by a flex when applying annotations recipe. I am not 100% sure, but when you want to delete the annotations bundle it will also remove this file.

But it makes sense to me to put all annotation route imports into config/routes/annotations.yaml file, because they just depend on this package.

Other routes you should put into the config/routes.yaml file.

Upvotes: 1

Related Questions