Example - Countries API
This is the most basic example of how to use RODB.
It takes a single CSV file as an input, and provides an HTTP service with one endpoint which returns a list of countries.
You can download and run this example locally (using Docker) with the following script.
The source code for this example is also available here.
The API provides a single endpoint with basic filtering:
GET http://localhost:3004/
: lists all the countriesGET http://localhost:3004/?continentCode=EU
: lists all the countries in EuropeGET http://localhost:3004/?countryCode=US
: returns a list containing only the USA
Here is a sample response body of this endpoint:
Since this example does not set-up any indexes, all of the parameters must be an exact match. It also means that RODB iterates all the records to find the requested ones, which is not recommended with a large data-set.