X Tutup
The Wayback Machine - https://web.archive.org/web/20200908190054/https://github.com/mgoffan/haproxy-json
Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
bin
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

HAProxy JSON

Usage and CLI options

  Usage: index [options] -f file [-f file]*

  Options:

    -V, --version          output the version number
    -f, --file <file>      Input file
    -o, --output [output]  Output file (default: haproxy.cfg)
    --tab-size [tab-size]  Tab size. Only applies if indented with (default: 2)
    -t, --tab [tab]        Flag to indent with tabs (default: false)
    -h, --help             output usage information

Example

sample.json

{
    "global": {
        "chroot": "/var/lib/haproxy1",
        "user": "haproxy",
        "group": "haproxy"
    },
    "defaults": {
        "mode": "http"
    }
}

sample2.json

{
    "global": {
        "chroot": "/var/lib/haproxy2",
        "user": "haproxy",
        "group": "haproxy"
    },
    "defaults": {
        "retries": 3
    }
}

When run with node index.js -f sample.json -f sample2.json --tab-size 8 outputs:

global
        chroot /var/lib/haproxy2
        user haproxy
        group haproxy
defaults
        mode http
defaults
        retries 3

About

Write HAProxy JSON configurations in a more friendly manner

Topics

Resources

Releases

No releases published

Packages

No packages published
You can’t perform that action at this time.
X Tutup