Created
November 7, 2019 16:47
-
-
Save ryangreenberg/6c2b36d9e7c9833eb2581d1ff76d775e to your computer and use it in GitHub Desktop.
Simple HHVM server
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function main(): noreturn { | |
$rsp = dict[ | |
'$_SERVER' => $_SERVER, | |
'$_GET' => $_GET, | |
'$_POST' => $_POST, | |
'$_REQUEST' => $_REQUEST, | |
'getallheaders' => getallheaders(), | |
'body' => file_get_contents('php://input'), | |
]; | |
echo json_encode($rsp, JSON_PRETTY_PRINT); | |
exit(0); | |
} | |
main(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# See https://stackoverflow.com/questions/59895 | |
dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
cd "$dir" | |
hhvm --no-config --mode server --port 8888 -d hhvm.server.default_document=index.hack -d hhvm.server.error_document404=index.hack |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment