本地与服务端保持随时同步问题

  1. 问题描述

在服务端开发时,我们需要把本地开发的代码发布到服务端,尤其是在使用lua这种脚本时,实时的同步lua代码变得尤为重要

  1. 解决方案

今天介绍的方案是使用nobone-sync这个工具来实现

  1. 服务端安装
  • nodejs安装
  • npm install -g nobone-sync
  • 配置文件sync-config.js
module.exports = {
    rootAllowed: '/home/sync',
    host: '127.0.0.1',
    port: 8099,
    pattern: '**',
    password: 'test',
    algorithm: 'aes128',
    onChange: function(type, path, oldPath){}
};
  • 启动 nobone-sync -s sync-config.js
  1. 客户端安装
  • nodejs安装
  • npm install -g nobone-sync
  • 配置文件sync-config.js
module.exports = {
    localDir: 'h:\sync\test\',
    remoteDir: '/home/sync/test/',
    host: '服务器地址',
    port: 8099,
    pattern: '**',
    password: 'test',
    pollingInterval: 800
};
  • 启动 nobone-sync sync-config.js
  1. 最后的效果
原文地址:https://www.cnblogs.com/zjzyh/p/6289505.html