From 9ff6e6bfe456b912b6b8ebf987e2d9c875bcfc5b Mon Sep 17 00:00:00 2001 From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com> Date: Wed, 4 Aug 2021 15:26:13 +0800 Subject: [PATCH] add platform Vercel --- index.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/index.php b/index.php index 3e584dc..f029312 100644 --- a/index.php +++ b/index.php @@ -6,6 +6,7 @@ include 'conststr.php'; include 'common.php'; //echo '
'. json_encode($_SERVER, JSON_PRETTY_PRINT).''; +//echo '
'. json_encode($_ENV, JSON_PRETTY_PRINT).''; if (isset($_SERVER['USER'])&&$_SERVER['USER']==='qcloud') { if (getenv('ONEMANAGER_CONFIG_SAVE')=='file') include 'platform/TencentSCF_file.php'; else include 'platform/TencentSCF_env.php'; @@ -30,6 +31,19 @@ if (isset($_SERVER['USER'])&&$_SERVER['USER']==='qcloud') { } http_response_code($re['statusCode']); echo $re['body']; +} elseif (isset($_SERVER['DOCUMENT_ROOT'])&&$_SERVER['DOCUMENT_ROOT']==='/var/task/user') { + include 'platform/Vercel.php'; + $path = getpath(); + //echo 'path:'. $path; + $_GET = getGET(); + //echo '
'. json_encode($_GET, JSON_PRETTY_PRINT).''; + $re = main($path); + $sendHeaders = array(); + foreach ($re['headers'] as $headerName => $headerVal) { + header($headerName . ': ' . $headerVal, true); + } + http_response_code($re['statusCode']); + echo $re['body']; } else { include 'platform/Normal.php'; $path = getpath();