This is a simple HTTP server written in Ruby that converts JSON data to CSV format.
To run this server, you will need to have Ruby installed on your computer. You can download Ruby from the official website.
Once you have ruby installed, you can install the required depencencies by runnning the following command in the project directory:
$ gem install webrick
To start the server, run the following command:
$ ruby server.rb
This will start the server on 'localhost:8000'
To convert a JSON file to a CSV, send a POST request to the /convert endpoint with the JSON data in the request body.
$ curl -X POST -H "Content-Type: application/json" -d '[{"name":"Alice","age":25,"email":"alice@example.com"}]' http://localhost:8000/convert
The server will return a CSV file in the response body.
name,age,email
Alice,25,alice@example.com
To run the test suite, run the following command:
$ ruby test_suite.rb
This project is MIT licensed