0

I am trying to set up a multi-site architecture in Symfony 4 using multiple Kernels.

It would be too lengthy to post all of the changes I have made but I basically followed the Symfony docs for creating a new Kernel and the changes I made can be viewed in the following pull request.

When I attempt to run the api kernel locally (php bin/api server:run) I get the following error message:

Error Message

I am simply trying to load the home controller and template using the new Kernel

# config/api/routes.yaml

home:
    path: /
    controller: App\Controller\Home::index
Stephan Vierkant
  • 9,674
  • 8
  • 61
  • 97
yevg
  • 1,846
  • 9
  • 34
  • 70
  • Double check where routes.yaml is being loaded. looks like you have it loaded under configureContainer instead of configureRoutes. – Cerad May 15 '19 at 15:43

1 Answers1

1
  1. Place routes.yaml under config/routes directory, otherwise Symfony treats this file as a framework configuration file.

  2. Or you can reconfigure kernel to load routes files from api directory by editig configureContainer and configureRoutes methods of ApiKernel.

Vadim Ashikhman
  • 9,851
  • 1
  • 35
  • 39
  • thank you! I think (2) is more what Im looking for - such that I can completely encapsulate an application, including its routes. what changes would I make to `configureContainer` and `configureRoutes` methods? – yevg May 15 '19 at 17:34