Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env groovy
- @Grapes([
- @Grab('io.ratpack:ratpack-groovy:1.5.4'),
- @Grab('org.slf4j:slf4j-simple:1.7.25')
- ])
- import static ratpack.groovy.Groovy.ratpack
- import ratpack.server.ServerConfig
- def serverPort = 8000
- def contentRoot = 'path/to/your/files'
- def indexFile = 'index.html'
- ratpack {
- serverConfig {
- port(serverPort)
- }
- handlers {
- files {
- dir(contentRoot)
- indexFiles(indexFile)
- }
- }
- }
Add Comment
Please, Sign In to add comment