0

I've just started looking at Ratpack, and my initial use case to as a simple development server. It seems quite trivial to get it to serve a directory of static files (in Groovy), I paraphrase this article:

#!/usr/bin/env groovy

@Grab('io.ratpack:ratpack-groovy:1.5.1')
import static ratpack.groovy.Groovy.ratpack

ratpack {
    handlers {
        files { dir "static" index }
    }
}

I see there's an option to define an index page (for example, index.html), but this is static. I'd like it to serve a dynamic directory listing, as Apache can. I'd hoped this would simply require enabling a option, but I cannot find any indication such a thing exists.

I can't help feeling I have missed something. Can anyone point me in the right direction?

wu-lee
  • 749
  • 4
  • 17
  • 2
    I don't believe there's anything out of the box (or a config option you can turn on). You'll need to write a handler that (based on a prefix) returns the contents of that folder – tim_yates Jan 25 '18 at 13:42

1 Answers1

0

There's no built in directory listing feature. You would have to implement your own.

Luke Daley
  • 571
  • 3
  • 6