ansible-community / ara-web

Stateless web client for the ARA Records Ansible API.
https://ara.recordsansible.org
GNU General Public License v3.0
37 stars 8 forks source link

Could the API endpoint be defined at runtime ? #12

Open dmsimard opened 5 years ago

dmsimard commented 5 years ago

It is probably a good thing to have a default API server out of the configuration but not unlike we have the ability to store the credentials locally, could there be something optional for specifying the endpoint ?

The use case is that we are working on porting the sqlite middleware from 0.x to 1.x (here) which will allow the API backend to serve different databases.

This would allow a single API server instance to host multiple endpoints, for example:

/var/www/logs/
├── 1
│   ├── ara-api
│   │   └── ansible.sqlite
│   └── console.txt
├── 2
│   ├── logs.tar.gz
│   └── some
│       └── path
│           └── ara-api
│               └── ansible.sqlite
└── 3
    ├── builds.txt
    ├── dev
    │   └── ara-api
    │       └── ansible.sqlite
    └── prod
        └── ara-api
            └── ansible.sqlite

Would allow endpoints to exist at:

Being able to change the API server at runtime would allow ara-web to connect to any of the above endpoints from a single instance.

This, in turn, would allow us to compile a static version of the web UI and run it from anywhere (including artifacts/logs) and attach it to any API server.