Skip to content

Commit

Permalink
Add robots.txt endpoint.
Browse files Browse the repository at this point in the history
  • Loading branch information
marc0der committed Dec 31, 2012
1 parent d284ecb commit 794b334
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 23 deletions.
28 changes: 5 additions & 23 deletions src/main/resources/server.groovy
Expand Up @@ -54,6 +54,11 @@ rm.get("/selfupdate") { req ->
req.response.sendFile('build/scripts/selfupdate.sh')
}

rm.get("/robots.txt") { req ->
addPlainTextHeader req
req.response.sendFile('build/resources/main/templates/robots.txt')
}

rm.get("/alive") { req ->
addPlainTextHeader req
req.response.end "OK"
Expand Down Expand Up @@ -174,29 +179,6 @@ rm.get("/broadcast/:version") { req ->
}


//
// leave here for legacy purposes
//

rm.get("/app/alive/:version") { req ->
def legacyBroadcast = new File('build/templates/legacy.gtpl')
def broadcast = legacyBroadcast.text
addPlainTextHeader req
req.response.end broadcast
}

rm.get("/res/init") { req ->
log 'init', 'n/a', 'n/a', req
addPlainTextHeader req
req.response.sendFile 'srv/scripts/gvm-init.sh'
}

rm.get("/res/gvm") { req ->
addPlainTextHeader req
req.response.sendFile 'srv/scripts/gvm'
}


//
// private methods
//
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/templates/robots.txt
@@ -0,0 +1,2 @@
User-agent: *
Disallow: /

0 comments on commit 794b334

Please sign in to comment.