i think this needs to be:

elif request == r'/close-server`

or

'\/close-server'

This is the url I'm  getting:

http://localhost:8001/\close-server