Skip to content

Write HAProxy JSON configurations in a more friendly manner

Notifications You must be signed in to change notification settings

mgoffan/haproxy-json

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published