endpoints

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:
  1. req (THTTPRequest)
  2. 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:
  1. req (THTTPRequest)
  2. resp (THTTPResponse)

getDomainInfoEp(req, resp) inner

The getDomainInfo endpoint. Return JSON representation of application Domain according to caller rights
Arguments:
  1. req (THTTPRequest)
  2. 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:
  1. req (THTTPRequest)
  2. 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:
  1. req (THTTPRequest)
  2. resp (THTTPResponse)