rex-sync-node
v1.1.0
Published
Together with [Rex-Sync Redaxo](https://github.com/AndyBitz/rex-sync-redaxo) this node module will allow you to live update Templates, Modules, AddOns and Assets on your Redaxo Website.
Downloads
6
Readme
Rex-Sync Node
Together with Rex-Sync Redaxo this node module will allow you to live update Templates, Modules, AddOns and Assets on your Redaxo Website.
Quickstart
In order to start you'll need to create two files in your npm root directory.
The first one will be rex.secrets.json
. This file will contain your credentials to your redaxo system. Make sure to add it to the projects .gitignore
file.
Example rex.secrets.json
:
{
"auth": "auth_key_from_rex-sync-redaxo_addon"
}
The next file will be a short configuration file called rex.config.json
. It will contain paths to the specific directories. This file should be stored in your repo.
Example rex.config.json
:
{
"website": "https://www.example.com",
"templates": "./path/to/templates/",
"modules": "./path/to/modules/",
"addons": "./path/to/addons/",
"assets": "./path/to/assets/"
}
Now, install the package through npm:
npm install -g rex-sync-node
... and start
cd my-project
rex-sync
Don't forget to install the redaxo addon.
Notes:
The
modules
folder must look like this:modules/My Module/output.php
,modules/My Module/input.php
Everything will be identified by their name not their id. Files that are deleted in yourAssets
orAddOns
folder will get deleted on the server as well.Templates
andModules
on the other hand will stay on the server since deleting them might break your site in a more permanant way.
Start it programmatically
In case you want to add it to your existing dev script etc.
npm install --save-dev rex-sync-node
const rex = require('rex-sync-node')
rex() // async function that starts to watch the paths in rex.config.json
Contribute
Feel free to open an issue or a pull request.
Developing on rex-sync-node
- Create a
rex.secrets.json
file. - Add your website to
rex.secrets.json
instead. So you won't accidentally commit it. - Run
npm run dev
. This will enable the debug log.