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. 最后的效果
    本地与服务端保持随时同步问题

相关文章:

  • 2021-09-02
  • 2021-11-13
  • 2021-12-26
  • 2021-08-02
  • 2021-06-22
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-01
  • 2021-07-02
  • 2021-10-17
  • 2021-11-07
  • 2022-12-23
  • 2021-12-11
相关资源
相似解决方案