We want to be able to place the existing wiki-server within the context of other local (and remote) servers, and to have this setup under programtic control.
# Current solution
The current solution involved: 1. Hostname resolution using /etc/hosts file 1. Caddy as a reverse proxy 1. Wiki-server to serve wiki on port 3000 1. Live Server to server wiki-json on specific domains
# Tried but avoiding Here are a few things we've tried, but they turned out problematic for one reason or another. The first was:
While this looks one way to go, and is fairly straight forwards - it has the dissadvantage of having to amintain a separate fork of the wiki-server code. It is alos not as flexible as having a full reverse proxy installed.
We also created a Livecode native: - Live Server
But this got a lot more complex than initially conceived (we thought we just needed to serve json files and a favicon). While we implemented intialising the wiki and registering the plugin routes - when we got to having to handle large media files it became clear that a better route would be to control a robust local server implementation that has already been written in another language.
We also tried running Tinyproxy to handle the redirects, but this only met with partial success. It appears that it does not handle wildcards, and the config for multiple proxying based on domains is either not possible or complex to grok.
The standard ways to run a reverse proxy locally is to use something like nginx. The benefit of this is that we can deploy the same servers in production online and reuse the learning. This disadvantage is that they are relatively heavy, and do not allow changes to routing without a server restart.