Getting started with Janus Web Server

From m204wiki
Jump to navigation Jump to search

How the server will respond to a request from a browser is determined by the JANUS DEFINE and JANUS WEB commands for the server port. In addition to the documentation for those commands, see Defining Web rules, which describes the Janus Web Server processing controlled by the JANUS WEB command.

Sample server “rules” decks and applications are included in the SIRIUS file on the Sirius product tape:

  • To implement a server, alter one of the sample sets of rules — procedures prefixed with JANWEB_CONF — to your site's requirements. The rules can be re-executed while the server is up, and even while users are connected. So it is easy to start a Janus Web Server port and tune its configuration: just point your browser to it, and modify JANUS WEB commands and the procedures they reference until the Web Server has the right properties.
  • The SIRIUS (or JANUS) file also contains a complete Web-based application which can be used as is or altered to suit your needs. The application-level API is a simple set of $functions that provides all the power you need to write complex web-based applications.

Basically, incoming URLs are treated as tokens, and the Web Server can simply return the requested resources from the Model 204 procedures where they are stored (HTML, GIF files, and other binaries can be stored in Model 204 procedures). Or, the URL can be used as a trigger to initiate a User Language application which can process forms, build custom HTML documents, or take other actions. Janus Web Server comes with two utilities for loading files into Model 204 procedures:

SIRPIPE, which uses Model 204 BATCH2 threads, and SIRPUT, which uses HTTP PUT. Both of these utilities can load GIFs, JPGs, WAV files, AVI files, Adobe Portable document format files (PDFs), and any other binaries into Model 204. SIRPIPE and SIRPUT are described in detail in Loading with the SIRPIPE and SIRPUT utilities.

In addition to these utilities, binary files can be loaded to Model 204 using the "Form Based Upload" utility that appears on the default home page when Janus Web Server is installed. This is described further in Uploading files to a Janus Web Server. Also, after a small set of "receive" rules are defined, HTTP-PUT uploads can be used to migrate entire directories from a local machine to Janus Web Server. To learn about HTTP PUT capabilities, see "HTTP PUT support", and investigate the "Publish" feature of your web browser. Lastly, the Janus FTP Server lets you load directly to and from Model 204 procedure files. The Janus FTP Server is a Janus Sockets product.

See also