Hi! I'd have some proposals for changes to the superglue-protocol which I'd like to open for discussion. Using different posts for the different proposals to keep discussions focused..
The editor/plugin assumes that http://DOMAIN/ is the base-url for any requests, thus when running commands the URL http://DOMAIN/cmd
is called. If the server is set up like this that's perferctly fine, but for a not superglue-specific firmware/server or shared hosting that's not necessarily the case.
So I would suggest somehow passing a configuration value that defines the base-url of the superglue-backend, such that it could be http://DOMAIN/this/is/where/superglue/lives/forever/
From the top of my head the following options for communicating the base url from the server to the editor come to mind:
- use HTTP meta-tag to given base-url
- use HTTP meta-tag to a JSON formatted config string which amongst others will contain the base url and possibly any other values (currently at least the superglue version is passed along)
- use HTTP meta-tag to a URL containing a set of (JSON-formatted) configuration settings
option 1 would be the least invasive and quickest to implement and I guess unless there won't be too many other options the http header won't be flooded. It's also a rather stateless and decentralized approach. Unless there would be any need for lots and lots of configuration values I'd go for that.
option 3 would seem the most complex and centralized, but id consider it if ever the amount of config values would gros infinitely....