On 04/07/2015 14:13, Jim Lux wrote:
...
BUT now, I'd like to add a web interface, so that it can be
manipulated by a mobile device using a browser.
...
Is the best scheme to go in and modify the webserver code to look for
specific URLs requested, and then fire off some custom code to do what
I want?
...
No, almost certainly not.
Pretty much every webserver ever written allows you to run a script in
response to a request. Nowadays there are frameworks that integrate
closely with the language of your choice and do all the heavy lifting
for you.
If fact, the problem is really too much choice, here's a list of
frameworks from the Python wiki:
https://wiki.python.org/moin/WebFrameworks
If you want lots of functionality then head for the top of the list, but
these are overkill for what you are trying to do.
Scroll down to the 'Non Full Stack Frameworks' and pick one that makes
sense to you. These should all allow you to route a URL to some Python
code, and the process should be simple enough that if you spend more
than 15 mins to get an example up and running then just ditch it and
move on to the next one.
One caveat, if you are planning to put this on the public internet then
it's a very good idea to proxy the service behind a 'full-fat' webserver
(e.g. apache) that can safely manage access, load, security etc. I
wouldn't expose a BBB directly to the Internet, especially one that is
controlling expensive physical things.
Simon
_______________________________________________
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.