serve content over http
This service requires MESG Engine to be installed first.
You can install MESG Engine by running the following command or follow the installation guide.
bash <(curl -fsSL https://mesg.com/install)
To deploy this service, go to this service page on the MESG Marketplace and click the button "get/buy this service".
Event key: request
This event is emited on every page request.
Name | Key | Type | Description |
---|---|---|---|
sessionID | sessionID |
String |
Session ID of corresponding page request |
path | path |
String |
Path of HTTP request. |
method | method |
String |
Method of HTTP request. |
qs | qs |
Any |
Query string of HTTP request. |
body | body |
Any |
Body of HTTP request. |
host | host |
String |
Host of HTTP request. |
ip | ip |
String |
IP address of HTTP request. |
Task key: completeSession
This task should be called to response a pending page requests.
Name | Key | Type | Description |
---|---|---|---|
sessionID | sessionID |
String |
Session ID of corresponding page request |
error | error |
Object |
optional Error should be used to response with pre-existing errors |
code | code |
Number |
optional Status code of HTTP response. |
mimeType | mimeType |
String |
optional MIME type of HTTP response. |
content | content |
String |
optional Content of HTTP response. |
cache | cache |
Boolean |
optional Optionally cache this response for same requests. |
Output key: sessionID
Session ID of corresponding page request
Name | Key | Type | Description |
---|
Output key: elapsedTime
Elapsed time in nanoseconds for page request to complete
Name | Key | Type | Description |
---|
Task key: cache
Cache an http request with pre created response
Name | Key | Type | Description |
---|---|---|---|
method | method |
String |
Method of HTTP request |
path | path |
String |
Path of HTTP request |
code | code |
Number |
optional Status code of HTTP response |
mimeType | mimeType |
String |
optional MIME type of HTTP response |
content | content |
String |
optional Content of HTTP response |
Output key: message
Name | Key | Type | Description |
---|
Task key: breakCache
Break cache for http request
Name | Key | Type | Description |
---|---|---|---|
path | path |
String |
Path of HTTP request to break cache. |
method | method |
String |
Method of HTTP request to break cache. |
Output key: message
Name | Key | Type | Description |
---|