A simple web API for serving data from json, SQLite or csv static files to json.
To start Exapisd:
- Run
git clone...
from the repository - Install dependencies with
mix deps.get
- Run
mix compile
- Set the repository path
repo
inconfig.exs
- Start Phoenix endpoint with
mix phx.server
or inside IEx withiex -S mix phx.server
Now you can visit localhost:4000
from your browser.
Ready to run in production? Please check Phoenix deployment guides.
The API's web links serves the data as it is structured in the file repository on the server.
Considering the repository path is ./temp/repo
and in the sub-directory /test/
there is test.json
file:
./temp/repo/json/test.json
. Then the web API link will be http://localhost:4000/json
The repository structure can be nested as well: for ./temp/repo/json/another/test2.json
you get http://localhost:4000/json/another
Other examples:
./temp/repo/sqlite/testsqlite.db
-> http://localhost:4000/sqlite./temp/repo/csv/large/foe.csv
-> http://localhost:4000/csv/large
The application serves the first alphabetically file found in it. If you have both bar.json
and foe.csv
in the same directory, the bar.json
will be fetched.
- tests/benchmarks
- add support for more data files types: xls, tsv, xml, unstructured
- handle errors related to corrupt files in a better way.
- documentation; ExDoc (?)
This application is in production (used internally) at the Joint Research Center of the European Commission.
Copyright © 2022 Quda Theo.
Exapisd source code is released under AGPL-3.0-or-later.