Careful, don't add your routes to config/packages/routing.yaml. That file contains the configuration of the routing package, not the definition of routes.
And run the server:
php -S 127.0.0.1:8080 -t public
Open in your browserhttp://localhost:8080/secret-agentTo verify that your Symfony installation is working before adding more pieces to it.
Let's install Encore and PhpExecJs
composer require webpack-encore
composer require nacmartin/phpexecjs
npm install --save left-pad
And write an encore config in webpack.config.ssr.js
var Encore =require("@symfony/webpack-encore");
module.exports = Encore.getWebpackConfig();
You will see that there is already a webpack.config.js already. Don't touch it for now. It makes sense to have two different Webpack configurations for the JS code that will be run in your client and in your server.
And place the code we stole to the MI6 unto into assets/js/app.js