src/JsController.php
public function js(Parameters $parameters, Config $config)
    {
        $collection = $parameters->get("collection");




        if (!isset($config->assets->js->collections[$collection])) {
            throw new RouteNotFoundException();
        }



        $assets = $config->assets->js->collections[$collection]->toArray();

        $content = "";

        foreach ($assets as $asset) {
            $content .= file_get_contents($asset);
        }



        $content = Minifier::minify(
            $content
        );



        return new Response(
            $content,
            Response::HTTP_OK,
            [
                "Content-Type" => "application/javascript",
            ]
        );
    }
public function js(Parameters $parameters, Config $config)
    {
        $collection = $parameters->get("collection");




        if (!isset($config->assets->js->collections[$collection])) {
            throw new RouteNotFoundException();
        }



        $assets = $config->assets->js->collections[$collection]->toArray();

        $content = "";

        foreach ($assets as $asset) {
            $content .= file_get_contents($asset);
        }



        $content = Minifier::minify(
            $content
        );



        return new Response(
            $content,
            Response::HTTP_OK,
            [
                "Content-Type" => "application/javascript",
            ]
        );
    }
@Uri("/js/{collection}")

@Requirements(
"collection"="[a-z0-9\-]+"
)