diff --git a/src/Potter/Bootstrap.php b/src/Potter/Bootstrap.php new file mode 100644 index 0000000..049444e --- /dev/null +++ b/src/Potter/Bootstrap.php @@ -0,0 +1,31 @@ + ['application/javascript; charset=utf-8']]); + } + + static private function getBootstrapStyle(ServerRequestInterface $request): ResponseInterface + { + return new Text( + text: file_get_contents(getcwd() . '/vendor/twbs/bootstrap/dist/jss/bootstrap.js'), + headers: ['Content-Type' => ['text/css; charset=utf-8']]); + } + + static private function mapRoutes(Container $container, \Potter\Router\Router $router): void + { + $router->map('GET', '/bootstrap.js', [self::class, 'getBootstrapScript']); + $router->map('GET', '/bootstrap.css', [self::class, 'getBootstrapStyle']); + } +}