2015-05-25 214 views
0

我已經在ec2上設置了stongloop。 一切運行良好。我可以訪問api資源管理器。StrongLoop API瀏覽器刷新

我使用Strong Arc composer來發現本地mysql數據庫中的模型,並將它們公開。我可以在我的應用程序服務器文件夾中的文件model-config.json上看到暴露的模型。

但是探險家並不清爽。我無法在資源管理器中看到新模型。我找到的解決方案是重新啓動整個服務器,但我無法想象這是唯一的解決方案。有人有線索嗎?

感謝,

+0

根據文檔,似乎重新啓動是建議的方式:「對應用程序進行更改後,單擊重新啓動按鈕以重新啓動應用程序,以便可以看到更改。」 http://docs.strongloop.com/display/APIS/Running+an+app –

回答

0

所以我找到了最簡單的方法是殺死進程,然後使用以下命令重新啓動: nohup service slc-initd start

注意到我的SLC-INITD是我的init.d下面的腳本文件夾(沒有信用我此腳本):

#!/usr/bin/env bash 
 

 
# chkconfig: 345 99 01 
 
# description: startup of slc loopback 
 

 
NAME="Init.d SLC" 
 
NODE_BIN_DIR="/usr/bin" 
 
NODE_PATH="/usr/lib/node_modules" 
 
APPLICATION_DIRECTORY="/home/ec2-user/dev/mpos" 
 
#APPLICATION_START="src/cluster-worker.js" 
 
PIDFILE="/var/run/initd-example.pid" 
 
LOGFILE="/var/log/slc-initd.log" 
 

 
start() { 
 
    echo "Starting $NAME" 
 
    echo "cd $APPLICATION_DIRECTORY" 
 
    cd $APPLICATION_DIRECTORY 
 
    echo "slc run --pid $PIDFILE --log $LOGFILE" 
 
    slc run --pid $PIDFILE --log $LOGFILE 
 
    RETVAL=$? 
 
} 
 

 
stop() { 
 
    if [ -f $PIDFILE ]; then 
 
     echo "Shutting down $NAME" 
 
     echo "cd $APPLICATION_DIRECTORY" 
 
     cd $APPLICATION_DIRECTORY 
 
     echo "slc runctl stop" 
 
    slc runctl stop 
 
     # No need to get rid of the pidfile, slc does that for us. 
 
     RETVAL=$? 
 
    else 
 
     echo "$NAME is not running." 
 
     RETVAL=0 
 
    fi 
 
} 
 

 
restart() { 
 
    if [ -f $PIDFILE ]; then 
 
     echo "Restarting $NAME" 
 
     echo "cd $APPLICATION_DIRECTORY" 
 
     cd $APPLICATION_DIRECTORY 
 
     echo "slc runctl restart" 
 
     slc runctl restart 
 
    else 
 
     echo "$NAME isn't currently running. Starting from scratch ..." 
 
     start 
 
    fi 
 
} 
 

 
status() { 
 
    echo "Status for $NAME:" 
 
    cd $APPLICATION_DIRECTORY 
 
    slc runctl status 
 
    RETVAL=$? 
 
} 
 

 
case "$1" in 
 
    start) 
 
     start 
 
     ;; 
 
    stop) 
 
     stop 
 
     ;; 
 
    status) 
 
     status 
 
     ;; 
 
    restart) 
 
     restart 
 
     ;; 
 
    *) 
 
     echo "Usage: {start|stop|status|restart}" 
 
     exit 1 
 
     ;; 
 
esac 
 
exit $RETVAL