ODataDB Endpoints

ODataDB Endpoints

ODataDB serves three types of endpoints:

  • Static files
  • OData API endpoints
  • Edit page endpoints

Static Files

You can place static files in the wwwroot subfolder.

ODataDB includes its set of files to allow getting and editing database data using a built-in JavaScript client.

OData API Endpoints

ODataDB creates a set of endpoints for each connection specified in the appsettings.json file:

  • <domain>/<API root>/<connection name>/
  • <domain>/<API root>/<connection name>/<container name>/
  • <domain>/<API root>/<connection name>/<container name>/<language>/
  • <domain>/<API root>/<connection name>/<language>/

You can customize the API root and the default container name in the appsettings.json file.

Endpoint examples:

Edit Page Endpoints

ODataDB creates endpoints for each edit root specified in the EditRoots setting in the appsettings.json file:

  • <domain>/<edit root>/<connection name>/
  • <domain>/<edit root>/<connection name>/<container name>/
  • <domain>/<edit root>/<connection name>/<container name>/<language>/
  • <domain>/<edit root>/<connection name>/<language>/

ODataDB returns the edit page content for any URL that starts with the edit root.

For example:

This feature allows using the window.location.href value in the edit page to calculate an actual API URL.

For example, the edit page at the first URL calls the second URL to load data: