-
Notifications
You must be signed in to change notification settings - Fork 3
API
This app now comes with an API, so you can control it RESTfully, if you're so inclined. While writing this, I've had to make a whole bunch of big design decisions, and refactor a lot of code that's been basically untouched since I started writing this application. Thus, if you don't need to use the API, and you prefer reliability, you may want to pull an older branch that doesn't include it. The API gives panel_gen a lot of cool new functionality, but because of the much greater complexity, there's a good chance that things will break.
- panel_gen.py can be run on its own, but to use the API, you'll want to run http_server.py instead.
http_server
importspanel_gen
as a module, and provides a nice front end, thanks to flask and connexion. - The http server starts two nice services that you can access via a browser. If you browse to localhost:5000, you'll see a nice remote control page, that works great on a mobile phone. (Thanks, Skeleton!) Also, if you navigate to localhost:5000/api/ui, you'll see the nice Swagger playground that you can use to test out API calls.
The API has 3 main paths, each with somewhat meaningful sub-paths. In designing the functional layout, I tried to focus on things that I need the program to do during the normal course of my work at the museum. The three main paths are /app/, /lines/ and /switches/. Hopefully these are mostly self-explanatory, but if you need to try it out, the Swagger playground mentioned above should give you a pretty good idea of what they do.
More complete documentation. For now, please see swagger.yml.