Guest User

Untitled

a guest
Mar 19th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. #!/usr/bin/env groovy
  2.  
  3. @Grapes([
  4. @Grab('io.ratpack:ratpack-groovy:1.5.4'),
  5. @Grab('org.slf4j:slf4j-simple:1.7.25')
  6. ])
  7.  
  8. import static ratpack.groovy.Groovy.ratpack
  9. import ratpack.server.ServerConfig
  10.  
  11. def serverPort = 8000
  12. def contentRoot = 'path/to/your/files'
  13. def indexFile = 'index.html'
  14.  
  15. ratpack {
  16. serverConfig {
  17. port(serverPort)
  18. }
  19. handlers {
  20. files {
  21. dir(contentRoot)
  22. indexFiles(indexFile)
  23. }
  24. }
  25. }
Add Comment
Please, Sign In to add comment