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")
.
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}) |
AddGetFromEvent(parameters As roAssociativeArray) As Boolean
...