锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲国产另类久久久精品小说 ,国产午夜亚洲不卡,亚洲av产在线精品亚洲第一站http://blogjava.net/paulwong/category/54497.htmlzh-cnTue, 26 Jan 2021 17:18:24 GMTTue, 26 Jan 2021 17:18:24 GMT60銆屾祴璇曘?- 鎺ュ彛嫻嬭瘯 & mock宸ュ叿Mocohttp://www.tkk7.com/paulwong/archive/2021/01/21/435777.htmlpaulwongpaulwongThu, 21 Jan 2021 06:09:00 GMThttp://www.tkk7.com/paulwong/archive/2021/01/21/435777.htmlhttp://www.tkk7.com/paulwong/comments/435777.htmlhttp://www.tkk7.com/paulwong/archive/2021/01/21/435777.html#Feedback0http://www.tkk7.com/paulwong/comments/commentRss/435777.htmlhttp://www.tkk7.com/paulwong/services/trackbacks/435777.html褰撻渶瑕佽皟鐢ㄧ涓夋柟HTTP鎺ュ彛鏃訛紝鍒漢鐨勬帴鍙h繕娌″畬鎴愶紝鍙厛鏍規嵁鎺ュ彛瀹氫箟鏂囨。錛岃繑鍥為傚綋鐨勬暟鎹紝浠ヤ究寮鍙戙?br />
鍦↙INUX涓婄殑閮ㄧ講緇撴瀯涓猴細
├── boot
│   ├── moco-runner-1.1.0-standalone.jar
│   └── .version
├── foo.json
├── logs
│   ├── back
│   └── moco.log
├── moco.sh
└── startup-moco.sh

.version鏂囦歡錛?br />
/path/to/boot/moco-runner-1.1.0-standalone.jar 1.1.0

moco.sh
#!/usr/bin/env bash

# Ensure this file is executable via `chmod a+x moco`, then place it
# somewhere on your $PATH, like ~/bin. The rest of moco will be
# installed upon first run into the ~/.moco directory.

if [ `id -u` -eq 0 ] && [ "$MOCO_ROOT" = "" ]; then
    echo "WARNING: You're currently running as root; probably by accident."
    echo "Press control-C to abort or Enter to continue as root."
    echo "Set MOCO_ROOT to disable this warning."
    read _
fi

echo $*

#export MOCO_HOME="$
{MOCO_HOME:-"$HOME/.moco"}"
export MOCO_HOME=$(cd `dirname $0`; cd boot; pwd)
VERSION_LOG_FILE="$MOCO_HOME/.version"

# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
    if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
        # IBM's JDK on AIX uses strange locations for the executables
        JAVACMD="$JAVA_HOME/jre/sh/java"
    else
        JAVACMD="$JAVA_HOME/bin/java"
    fi
    if [ ! -x "$JAVACMD" ] ; then
        die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
    fi
else
    JAVACMD="java"
    which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi

if [ "$HTTP_CLIENT" = "" ]; then
    if type -p curl >/dev/null 2>&1; then
        if [ "$https_proxy" != "" ]; then
            CURL_PROXY="-x $https_proxy"
        fi
        HTTP_CLIENT="curl $CURL_PROXY -f -L -o"
    else
        HTTP_CLIENT="wget -O"
    fi
fi

function download_failed_message 
{
    echo "Failed to download $1"
    echo "It's possible your HTTP client's certificate store does not have the"
    echo "correct certificate authority needed. This is often caused by an"
    echo "out-of-date version of libssl. Either upgrade it or set HTTP_CLIENT"
    echo "to turn off certificate checks
:"
    echo "  export HTTP_CLIENT=\"wget --no-check-certificate -O\" # or"
    echo "  export HTTP_CLIENT=\"curl --insecure -f -L -o\""
    echo "It's also possible that you're behind a firewall haven't yet"
    echo "set HTTP_PROXY and HTTPS_PROXY."
}

function download 
{
    $HTTP_CLIENT "$2.pending" "$1"
    if [ $? == 0 ]; then
        # TODO
: checksum
        mv -f "$2.pending" "$2"
    else
        rm "$2.pending" 2> /dev/null
        download_failed_message "$1"
        exit 1
    fi
}

function parse_tag 
{
   tag_value=`grep "<$2>.*<.$2>" $1 | sed -e "s/^.*<$2/<$2/" | cut -f2 -d">"| cut -f1 -d"<"`
}

function parse_maven_metadata 
{
    MOCO_METADATA_URL="http
://repo1.maven.org/maven2/com/github/dreamhead/moco-runner/maven-metadata.xml"
    MOCO_METADATA="/tmp/maven-metadata.xml"
    download $MOCO_METADATA_URL $MOCO_METADATA
    parse_tag $MOCO_METADATA latest
    LATEST_VERSION=$tag_value
}

function parse_standalone_latest_url 
{
    parse_maven_metadata
    VERSION=${LATEST_VERSION%
}
    LATEST_MOCO_STANDALONE_JAR="moco-runner-$VERSION-standalone.jar"
    MOCO_STANDLONE_URL="http://repo1.maven.org/maven2/com/github/dreamhead/moco-runner/$LATEST_VERSION/$LATEST_MOCO_STANDALONE_JAR"
}

function install 
{
    echo "Install moco"
    echo "Parse the latest version of moco"
    parse_standalone_latest_url
    echo "Download the latest moco
: $LATEST_VERSION"
    MOCO_STANDALONE="$MOCO_HOME/$LATEST_MOCO_STANDALONE_JAR"
    echo "$MOCO_STANDALONE $LATEST_VERSION" >> $VERSION_LOG_FILE
    download $MOCO_STANDLONE_URL $MOCO_STANDALONE
}

function load_current_version 
{
    read MOCO_STANDALONE CURRENT_VERSION < $VERSION_LOG_FILE
    if [[ "$(uname)" -ne "Darwin" && "$(expr substr $(uname -s) 2 6)" == "CYGWIN"   ]];then
        MOCO_STANDALONE=`cygpath -m "$MOCO_STANDALONE"`
    fi
}

function usage 
{
  printf "
options
:
       help      show help
       start     start server, e.g. moco start -p 12306 -c configfile.json
       shutdown  shutdown moco server 
       upgrade   upgrade moco
"
}

if [ ! -e "$MOCO_HOME" ]
then
    mkdir "$MOCO_HOME"
    install
fi

if [ "$1" = "start" ]; then
    echo "Starting"
    load_current_version
    exec "$JAVACMD" -jar "$MOCO_STANDALONE" $*
elif [ "$1" = "http" ]; then
    echo "Starting HTTP server"
    load_current_version
    exec "$JAVACMD" -jar "$MOCO_STANDALONE" $*
elif [ "$1" = "https" ]; then
    echo "Starting HTTPS server"
    load_current_version
    exec "$JAVACMD" -jar "$MOCO_STANDALONE" $*
elif [ "$1" = "socket" ]; then
    echo "Starting Socket server"
    load_current_version
    exec "$JAVACMD" -jar "$MOCO_STANDALONE" $*
elif [ "$1" = "shutdown" ]; then
    echo "Shutting down server"
    load_current_version
    exec "$JAVACMD" -jar "$MOCO_STANDALONE" $*
elif [ "$1" = "upgrade" ]; then
    echo "Check the new version"
    parse_maven_metadata
    load_current_version

    if [ "$LATEST_VERSION" = "$CURRENT_VERSION" ]; then
        echo "The current version of moco is the latest"
    else
        echo "Upgrading"
        rm $VERSION_LOG_FILE
        install
    fi
elif [ "$1" = "version" ]; then
    load_current_version
    echo "Moco version: $CURRENT_VERSION"
elif [ "$1" = "help" ]; then
    usage
else
    usage
fi

榪欐槸鏍規嵁GIT涓婄殑鍘熷鏂囦歡浣滅殑淇敼銆?br />

startup-moco.sh
CMD_PATH=$(cd `dirname $0`; pwd)

# 欏圭洰鏃ュ織杈撳嚭緇濆璺緞
LOG_DIR=$
{CMD_PATH}"/logs"
LOG_FILE="moco.log"
LOG_PATH="$
{LOG_DIR}/${LOG_FILE}"

# 褰撳墠鏃墮棿
NOW=`date +'%Y-%m-%m-%H-%M-%S'`
NOW_PRETTY=`date +'%Y-%m-%m %H:%M:%S'`

# 鍚姩鏃ュ織
STARTUP_LOG="================================================ $
{NOW_PRETTY} ================================================\n"

# 鏃ュ織澶囦喚鐩綍
LOG_BACK_DIR="$
{LOG_DIR}/back/"

# 濡傛灉logs鏂囦歡澶逛笉瀛樺湪,鍒欏垱寤烘枃浠跺す
if [[ ! -d "$
{LOG_DIR}" ]]; then
  mkdir "$
{LOG_DIR}"
fi

# 濡傛灉logs/back鏂囦歡澶逛笉瀛樺湪,鍒欏垱寤烘枃浠跺す
if [[ ! -d "$
{LOG_BACK_DIR}" ]]; then
  mkdir "$
{LOG_BACK_DIR}"
fi

# 濡傛灉欏圭洰榪愯鏃ュ織瀛樺湪,鍒欓噸鍛藉悕澶囦喚
if [[ -f "$
{LOG_PATH}" ]]; then
    mv $
{LOG_PATH} "${LOG_BACK_DIR}/${APPLICATION}_back_${NOW}.log"
fi

# 鍒涘緩鏂扮殑欏圭洰榪愯鏃ュ織
echo "" > $
{LOG_PATH}

# 鍙敮鎸佸涓猨son閰嶇疆鏂囦歡
$CMD_PATH/moco.sh http -p 8088 -g "${CMD_PATH}/root.json" > ${LOG_PATH} 2>&1 &

# 鎵撳嵃鍚姩鏃ュ織
echo -e $
{STARTUP_LOG}

root.json
[
    
{
        "context"
: "/service-a",
        "include": "foo.json"
    
},
    
{
        "context"
: "/service-b",
        "include": "bar.json"
    
}
]

foo.json
[
    
{
        "request"
: {
            "method": "post",
            "forms": {
                "method": "uploadKycInfo"
            
}
        },
        "response": 
{
            "json"
: {
                "response": {
                    "subcode": "10000",
                    "submsg": "Success",
                    "sndDt": "20210121101800",
                    "remark": "涓婁紶楠岃瘉鍩烘湰淇℃伅",
                    "msgBody": {
                        "merOrdrNo": "A00120210121654321",
                        "retCode": "00000",
                        "retMsg": "鎴愬姛/澶勭悊瀹屾垚",
                        "remark": "涓婁紶璇︽儏鎴栦笂浼犱俊鎭殑綆瑕佹弿榪?
                    
}
                },
                "code": "0000",
                "msg": "澶勭悊瀹屾垚",
                "sign": "DF2659FE3EB8184561135D9F55F5EF5"
            }
        }
    }
]

璁塊棶璺緞錛?br />
http://ip:port/service-a/

https://github.com/dreamhead/moco/blob/master/moco-doc/apis.md
https://zhuanlan.zhihu.com/p/60076337 
https://www.programmersought.com/article/68272293688/


paulwong 2021-01-21 14:09 鍙戣〃璇勮
]]>
RESTful 鏈浣沖疄璺?/title><link>http://www.tkk7.com/paulwong/archive/2014/08/18/417052.html</link><dc:creator>paulwong</dc:creator><author>paulwong</author><pubDate>Mon, 18 Aug 2014 00:47:00 GMT</pubDate><guid>http://www.tkk7.com/paulwong/archive/2014/08/18/417052.html</guid><wfw:comment>http://www.tkk7.com/paulwong/comments/417052.html</wfw:comment><comments>http://www.tkk7.com/paulwong/archive/2014/08/18/417052.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/paulwong/comments/commentRss/417052.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/paulwong/services/trackbacks/417052.html</trackback:ping><description><![CDATA[     鎽樿: 闄や簡浼犵粺瀵逛簬榪滅▼璋冪敤鐨勯渶姹傦紝榪戞潵縐誨姩寮鍙戝浜巃pi鐨勮鑼冨寲闇瑕侊紝restful浣滀負涓涓祦琛岀殑鎺ュ彛璋冪敤鏂瑰紡錛屽煎緱娣卞叆浜嗚В銆傚0鏄?nbsp;鏈枃灞炰簬杞澆錛氬師鏂囨鏂囦負瀹炶返鎬葷粨錛屾槸鑷繁鍦ㄥ疄璺佃繃紼嬩腑縐瘡鐨勭粡楠屽拰"鍝插"銆傞儴鍒嗗唴瀹瑰弬鑰冪浉鍏寵祫鏂欙紝鍙傝冨唴瀹硅鐪嬪熬欏點傚緩璁RESTful鏈変竴瀹氫簡瑙h呴槄璇?"鍝插"涓嶈涓轟簡RESTful鑰孯ESTful鍦ㄨ兘琛ㄨ揪娓呮鐨勬儏鍐典笅錛岀畝鍗曞氨鏄編鎺ュ彛璺緞璁捐鎺ュ彛璁捐鍘熷垯URI鎸囧悜...  <a href='http://www.tkk7.com/paulwong/archive/2014/08/18/417052.html'>闃呰鍏ㄦ枃</a><img src ="http://www.tkk7.com/paulwong/aggbug/417052.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/paulwong/" target="_blank">paulwong</a> 2014-08-18 08:47 <a href="http://www.tkk7.com/paulwong/archive/2014/08/18/417052.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <p>感谢您访问我们的网站,您可能还对以下资源感兴趣:</p> <a href="http://www.tkk7.com/" title="亚洲av成人片在线观看">亚洲av成人片在线观看</a> <div class="friend-links"> </div> </div> </footer> 主站蜘蛛池模板: <a href="http://caoliushequ9.com" target="_blank">免费观看男人免费桶女人视频</a>| <a href="http://yyfass.com" target="_blank">久久er国产精品免费观看8</a>| <a href="http://www8x5188x.com" target="_blank">黄床大片30分钟免费看</a>| <a href="http://caocl1024liu.com" target="_blank">亚洲综合色婷婷在线观看</a>| <a href="http://chinahongfeng.com" target="_blank">在线免费观看亚洲</a>| <a href="http://732r.com" target="_blank">亚洲黄色三级网站</a>| <a href="http://470577.com" target="_blank">亚洲国产精品乱码在线观看97</a>| <a href="http://lanoss.com" target="_blank">亚洲精品永久www忘忧草</a>| <a href="http://www045888.com" target="_blank">久久久久亚洲精品无码蜜桃</a>| <a href="http://www-65jjj.com" target="_blank">亚洲天天做日日做天天看</a>| <a href="http://hairdehf.com" target="_blank">亚洲最新视频在线观看</a>| <a href="http://wusongtv.com" target="_blank">亚洲精品视频观看</a>| <a href="http://qestest.com" target="_blank">亚洲乱码中文字幕小综合</a>| <a href="http://liulaogendawutai.com" target="_blank">激情综合亚洲色婷婷五月APP</a>| <a href="http://changfafangzhi.com" target="_blank">亚洲乱人伦精品图片</a>| <a href="http://tzntrip.com" target="_blank">亚洲最新在线视频</a>| <a href="http://jgc528.com" target="_blank">亚洲AV无码无限在线观看不卡</a>| <a href="http://jlzjjy.com" target="_blank">亚洲日韩亚洲另类激情文学</a>| <a href="http://louqibang.com" target="_blank">国产 亚洲 中文在线 字幕</a>| <a href="http://wxzg66.com" target="_blank">狼人大香伊蕉国产WWW亚洲</a>| <a href="http://qq2071.com" target="_blank">成人特级毛片69免费观看</a>| <a href="http://whdy888.com" target="_blank">在线观看免费黄网站</a>| <a href="http://952268.com" target="_blank">99精品视频在线观看免费播放 </a>| <a href="http://dyk7.com" target="_blank">亚洲精品一级无码鲁丝片 </a>| <a href="http://amgzh.com" target="_blank">四虎成人免费影院网址</a>| <a href="http://anyliz.com" target="_blank">国产精品国产自线拍免费软件 </a>| <a href="http://chuoche.com" target="_blank">6080午夜一级毛片免费看6080夜福利</a>| <a href="http://www33399.com" target="_blank">91高清免费国产自产拍2021</a>| <a href="http://666za.com" target="_blank">99在线视频免费观看视频</a>| <a href="http://gyqcy.com" target="_blank">国产伦一区二区三区免费</a>| <a href="http://8k4c.com" target="_blank">中文字幕中韩乱码亚洲大片</a>| <a href="http://2h6m.com" target="_blank">久久久影院亚洲精品</a>| <a href="http://hnmxld.com" target="_blank">国产日本亚洲一区二区三区</a>| <a href="http://znboxcdn304.com" target="_blank">亚洲欧美熟妇综合久久久久</a>| <a href="http://aa7852.com" target="_blank">一级人做人爰a全过程免费视频</a>| <a href="http://xj47777.com" target="_blank">免费在线观看一级片</a>| <a href="http://1314c.com" target="_blank">一二三四影视在线看片免费</a>| <a href="http://295301.com" target="_blank">全亚洲最新黄色特级网站</a>| <a href="http://445645.com" target="_blank">亚洲AV福利天堂一区二区三</a>| <a href="http://3t77.com" target="_blank">亚洲日本一线产区和二线产区对比</a>| <a href="http://chiyizi.com" target="_blank">无码的免费不卡毛片视频</a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>