Build-in UnityBase endpoints. Will be registered during UB.start
In addition to endpoints documented below additional endpoints
- ubql
- stat
- auth
- logout
- timeStamp are implemented inside native code and will be moved to JavaScript in future releases.
Methods
clientRequireEp(req, resp)
inner
The clientRequire
endpoint. Used by client side loaders (SystemJS for example) to emulate commonJS require
Security note: It is very important to prevent loading a server-side logic to the client - server-side logic MUST be hidden from clients
To do this clientRequire
endpoint:
- allow access only to modules inside application
node_modules
folder
- in case requested module is a UnityBase model (present in ubConfig.json) then restrict access to non-public part of such model
So developer should list all the modules that contain a sensitive server-side business logic inside the application
config and set a moduleName
parameter correctly for such models
Arguments:
-
req
(THTTPRequest)
-
resp
(THTTPResponse)
getAppInfoEp(req, resp)
inner
The getAppInfo
endpoint. Responsible for return a information about application required for a
initial client side connectivity and UI setup
Arguments:
-
req
(THTTPRequest)
-
resp
(THTTPResponse)
getDomainInfoEp(req, resp)
inner
The getDomainInfo
endpoint.
Return JSON representation of application Domain according to caller rights
Arguments:
-
req
(THTTPRequest)
-
resp
(THTTPResponse)
modelsEp(req, resp)
inner
The models
endpoint. Responsible for return a static files content from a model publicPath folders
For example request GET http://host:port/models/modelName/fileName
will return a file from a public folder of a model modelName
Arguments:
-
req
(THTTPRequest)
-
resp
(THTTPResponse)
staticEp(req, resp)
inner
Default endpoint. Will be called in case URL do not start form a known endpoint.
Current implementation will handle static files from ServerConfig.HTTPServer.inetPub
folder
Arguments:
-
req
(THTTPRequest)
-
resp
(THTTPResponse)
clientRequire
endpoint. Used by client side loaders (SystemJS for example) to emulate commonJS require
Security note: It is very important to prevent loading a server-side logic to the client - server-side logic MUST be hidden from clients
To do this clientRequire
endpoint:
- allow access only to modules inside application
node_modules
folder - in case requested module is a UnityBase model (present in ubConfig.json) then restrict access to non-public part of such model
So developer should list all the modules that contain a sensitive server-side business logic inside the application
config and set a moduleName
parameter correctly for such models
req
(THTTPRequest)
resp
(THTTPResponse)
getAppInfo
endpoint. Responsible for return a information about application required for a
initial client side connectivity and UI setup
req
(THTTPRequest)
resp
(THTTPResponse)
getDomainInfo
endpoint.
Return JSON representation of application Domain according to caller rights
req
(THTTPRequest)
resp
(THTTPResponse)
models
endpoint. Responsible for return a static files content from a model publicPath folders
For example request GET http://host:port/models/modelName/fileName
will return a file from a public folder of a model modelName
req
(THTTPRequest)
resp
(THTTPResponse)
ServerConfig.HTTPServer.inetPub
folder
req
(THTTPRequest)
resp
(THTTPResponse)