diff --git a/bin/common.sh b/bin/common.sh index 9d99efe..267b5c6 100644 --- a/bin/common.sh +++ b/bin/common.sh @@ -12,7 +12,7 @@ time=$(date "+%Y-%m-%d %H:%M:%S") # The common functions of ngxway is here. # ================================ -function computeSignedAPI() { +function computeSignedRequest() { timeStamp=`date +%s` (( length=timeStamp%16+10 )) @@ -24,17 +24,19 @@ function computeSignedAPI() { result=${signMd5: 0: $length} - signedAPI="http://${ngxway_addr}/?sign=${result}×tamp=${timeStamp}" + signedURL="http://${ngxway_addr}/?sign=${result}×tamp=${timeStamp}" + signedAPI="http://${ngxway_addr}/api/test?sign=${result}×tamp=${timeStamp}" } -function printSignedAPI() { - computeSignedAPI +function printSignedRequest() { + computeSignedRequest echo "timeStamp=$timeStamp" echo "length=$length" echo "sign=$sign" echo "signMd5=$signMd5" echo "result = " $result - echo "url = " $signedAPI + echo "url = " $signedURL + echo "api = " $signedAPI } function printWhichSystem(){ diff --git a/start.sh b/start.sh index a58a84b..6d94f68 100644 --- a/start.sh +++ b/start.sh @@ -73,9 +73,9 @@ else fi # Try to open it in your chrome if ngxway working in dev mode. -computeSignedAPI +computeSignedRequest echo -e "" -echo -e "Now, you can visit the api to test : " $signedAPI +echo -e "Now, you can visit the url to test : " $signedURL if [ $env == "dev" ]; then - open -a "/Applications/Google Chrome.app" $signedAPI > /dev/null 2>&1 + open -a "/Applications/Google Chrome.app" $signedURL > /dev/null 2>&1 fi diff --git a/test/generate_signed_api.sh b/test/generate_signed_api.sh index 9905379..6512181 100644 --- a/test/generate_signed_api.sh +++ b/test/generate_signed_api.sh @@ -1,4 +1,4 @@ currentDir=$(pwd) . $currentDir/bin/common.sh -printSignedAPI +printSignedRequest