【问题标题】:StrongLoop API Explorer RefreshStrongLoop API Explorer 刷新
【发布时间】:2015-06-11 15:38:33
【问题描述】:

我在 ec2 上设置了 stongloop。 一切运行良好。我可以访问 api explorer。

我使用 Strong Arc composer 来发现本地 mysql 数据库中的模型,并将它们公开。我可以在我的应用服务器文件夹中的文件 model-config.json 上看到暴露的模型。

但资源管理器并不令人耳目一新。我在资源管理器上看不到新模型。我找到的解决方案是重新启动整个服务器,但我无法想象这是唯一的解决方案。有人有线索吗?

谢谢,

【问题讨论】:

标签: loopbackjs strongloop


【解决方案1】:

所以我找到的最简单的解决方案是终止进程,然后使用以下命令重新启动: 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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-09-26
    • 2016-10-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-03-20
    • 1970-01-01
    相关资源
    最近更新 更多