Skip to content

Instantly share code, notes, and snippets.

@apaleslimghost
Last active December 15, 2015 00:09
Show Gist options
  • Save apaleslimghost/5170947 to your computer and use it in GitHub Desktop.
Save apaleslimghost/5170947 to your computer and use it in GitHub Desktop.
Simulate import•io's backend in holding mode.
require \http .create-server (req,res)->
status =
| req.url is '/' => 200
| otherwise => 503
res.write-head status,"Service Unavailable" {
"Content-Type": "application/json; charset=UTF-8"
"Connection": "close"
"X-Powered-By": "PHP/5.3.10-1ubuntu3.4"
"Server": "Apache/2.2.22 (Ubuntu)"
"Content-Length": 66
}
res.end '{"error":"We are down for maintenance. BRB!","code":"MAINTENANCE"}'
.listen 8001
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment