You can use Aloe Express to serve up both dynamically generated and static content. Use Xojo to connect to databases, Web services / APIs, etc, and then dynamically generate a variety of content types - HTML, images, JSON, etc. Or server up static files - stylesheets, images, etc.
Aloe Express gives developers convenient access to all attributes of an HTTP requests. Request parameters are available via GET and POST dictionaries. Headers are available as a dictionary.
Aloe Express provides access to the request path and path components (as an array of strings), making it very easy to route and process requests.
Aloe Express includes support for a mustache-like templating system. Easily merge data with a template to generate a response.
Aloe Express provides easy access to both request and response headers in the form of dictionaries. For example, to get access to a request header, you can do something like this...
Dim UserAgent As String = Request.Headers.Lookup("User-Agent", "")
And to set a response header, you can do something like this...
Request.Response.Headers.Value("Content-Type") = "application/json"
Use the Response.CookieSet method to set cookies. For example:
Dim ExpirationDate As Xojo.Core.Date Dim DateInterval As Xojo.Core.DateInterval = New Xojo.Core.DateInterval(0, 0, 0, 0, 0, 30) ExpirationDate = Xojo.Core.Date.Now + DateInterval Request.Response.CookieSet("AccountName", "email@example.com", ExpirationDate) Request.Response.CookieSet("PreferredLanguage", "French", ExpirationDate)
Getting cookies is just as easy. Simply refer to the Request.Cookies dictionary. For example:
Dim AccountName As String = Request.Cookies.Lookup("AccountName", "") Dim PreferredLanguage As String = Request.Cookies.Lookup("PreferredLanguage", "English")
Building a Web app and need to maintain state? No problem. With the Aloe Express SessionEngine class, you can effortlessly create and maintain sessions.
Aloe Express supports the WebSocket Protocol, enabling two-way communication between clients and the server.
Use server-side caching to store anything at all - content, data, etc. Storing something in the cache is as easy as...
App.CacheEngine.Put("DrummersTable", TableHTML, 60)
And retrieving something from the cache is as easy as...
TableHTML = App.CacheEngine.Get("DrummersTable")
Optionally compress responses using gzip.
Use Aloe Express's default 404 error handler, or roll your own custom error handler.
Optionally generate a log of requests and responses in the industry standard Extended Log File Format
You can configure the server (its port, minimum and maximum number of sockets, etc) using parameters in your code or using command line arguments. With support for command line arguments, you can easily launch multiple instances of your app in situations where you need to do load balancing.
New in Aloe Express v2.0, you can provide secure communications to your apps using secure sockets layer (SSL) technology.
New in Aloe Express v3.2, you can include XojoScript blocks in your HTML files. Aloe Express will automatically detect the scripts, run them, and include any output in the rendered page.
Aloe Express is Xojo to the core. That means you can compile your projects as 32 or 64-bit applications and deploy them on macOS, Windows, or Linux-based servers.
If you don't already have Xojo, hop over to Xojo.com and download it. It's absolutely free to try and develop with. You only need to pay when you're ready to compile and deploy an app.