For the most part, the local server is similar to a web server except isn't bound to a port and isn't running. It's a
stateless function invoked by native code. It's takes two parameters. The
appContext which holds things related to the
native app, like the native file system location for the SQLite database. The second is the
appRequest which is an
object that represents an HTTP request. The local server receives the request, processes it, and returns an
which is an object that represents an HTTP response. The native code does whatever it needs, based on the content of the
response. The native code and local server behave in a way that is similar to a client-server pattern.
The local server framework is similar to Actix-Web and actually uses actix-router. It also leverages Diesel with SQLite, handlebars for rendering, and handful of other crates.
appContexton each request is a bit annoying. Sharing memory between the native file system and Rust would solve this.