Panel | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||
ON THIS PAGE
|
...
Code Block | ||
---|---|---|
| ||
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")
.
Note that you need to define all content types of the folder in order for the folder to be properly 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}) |
AddGetFromEvent(parameters As roAssociativeArray) As Boolean
...