Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Panel
borderColor#3D3D3D
bgColor#F4F4F4
titleColor#3D3D3D
borderWidth0
titleBGColor#3D3D3D
borderStylesolid

ON THIS PAGE

Table of Contents
indent20px

...

Code Block
titleExample
 server = CreateObject("roHttpServer", { port: 443, http: { certificate_file: "cert.pem", passphrase: "sekrit" } })


ifHttpServer

Each “Add” handler method described below takes an associative array as its parameter. Values in the associative array specify how the handler behaves. See the table at the end of this section for common key:value pairs.

...

    • headers : An associative array containing arbitrary headers to be included with the automatic response.
    • content_type : The contents of the "Content-Type" header included with the automatic response. This cannot be set in the same filter as the headers. The MIME type and character set can be specified together (e.g. "text/plain; charset=utf-8") .

...

You must define all

...

of the folder

...

content types for the folder to be

...

correctly uploaded to the server. For example:

Code Block
mimeTypes = [{ext: ".html", content_type:"text/html;charset=utf-8"},{ext: ".js", content_type:"text/javascript;charset=utf-8"},{ext: ".css", content_type:"text/css;charset=utf-8"},{ext: ".png", content_type:"image/png"},{ext: ".otf", content_type:"font/otf"}]

server.AddGetFromFolder({ url_prefix: "/GetFolder", folder: "Example", filters: mimeTypes})

...