Package ninja

Class AssetsController


  • public class AssetsController
    extends Object
    This controller serves public resources under /assets. It is capable of serving static files, webjars or files from a completely different directory on the server.
    • Method Detail

      • serveStatic

        public Result serveStatic()
        Serves resources from the assets directory of your application. For instance: route: /robots.txt A request to /robots.txt will be served from /assets/robots.txt. You can also use a path like the following to serve files: route: /assets/{fileName: .*} matches /assets/app/app.css and will return /assets/app/app.css (from your jar).
      • serveWebJars

        public Result serveWebJars()
        Serves resources from the assets directory of your application. For instance: A request to /robots.txt will be served from /assets/robots.txt. Request to /public/css/app.css will be served from /assets/css/app.css.