A server-side processor for JSONata that supports JSON and CSV input/output
npm install jsonata-server
//BINDINGS at the end of your JSONata expression, followed by your custom bindings.
"hello there!" ~> $firstLetterUppercase
//BINDINGS
{
firstLetterUppercase(input) {
return input.charAt(0).toUpperCase() + input.slice(1);
}
}
`
will produce the following result
`json
"Hello there!"
`
Mustache templating
Simply call $mustache to perform render a template
`
{"firstName": "John", "lastName": "Doe"} ~> $mustache("
Hello {{firstName}} {{lastName}} !!
")
`
will produce the following result (Raw output mode):
`
Hello John Doe !!
`
Getting Started
$3
> [!NOTE]
> NodeJS >=18.3 must be installed on your machine
1. Install NPM CLI package globally:
`sh
npm install -g jsonata-server
`
2. Start the server:
`sh
PORT=3000 jsonata-server
`
$3
> [!NOTE]
> You must be authenticated on the Github Container Registery
`
docker run -d -p 3000:3000 ghcr.io/joussy/jsonata-server
`
$3
Open your browser and navigate to http://localhost:3000
Build from sources
$3
1. Clone the repository:
`sh
git clone https://github.com/joussy/jsonata-server.git
`
2. Navigate to the project directory:
`sh
cd jsonata-server
`
3. Install the dependencies
`sh
npm install
`
$3
1. Build the Docker image:
`sh
docker build -t jsonata-server .
`
$3
2. Run the Docker container:
`sh
docker run -d -p 3000:3000 --name jsonata-server jsonata-server
``