DBGate Endpoints
DBGate serves three types of endpoints:
- Static files
- API endpoints
- Edit page endpoints
Static Files
You can place static files in the wwwroot subfolder.
DBGate includes such files to allow getting and editing database data using a built-in JavaScript client.
API Endpoints
DBGate creates a set of endpoints for each connection specified in the appsettings.json file:
- <domain>/<API root>/<connection name>/
- <domain>/<API root>/<connection name>/<schema name>/
- <domain>/<API root>/<connection name>/<schema name>/<language>/
- <domain>/<API root>/<connection name>/<language>/
You can customize the API root in the appsettings.json file.
Endpoint examples:
- https://dbgate.savetodb.com/api/mssql-023/
- https://dbgate.savetodb.com/api/mssql-023/s02/usp_cashbook2
- https://dbgate.savetodb.com/api/mssql-023/en-us/s02/usp_cashbook2
- https://dbgate.savetodb.com/api/mssql-023/fr-ca/s02/usp_cashbook2
Edit Page Endpoints
DBGate 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>/<schema name>/
- <domain>/<edit root>/<connection name>/<schema name>/<language>/
- <domain>/<edit root>/<connection name>/<language>/
DBGate returns the edit page content for any URL that starts with the edit root.
For example:
- https://dbgate.savetodb.com/edit/mssql-023/
- https://dbgate.savetodb.com/edit/mssql-023/s02/usp_cashbook2
- https://dbgate.savetodb.com/edit/mssql-023/en-us/s02/usp_cashbook2
- https://dbgate.savetodb.com/edit/mssql-023/fr-ca/s02/usp_cashbook2
This feature allows using the window.location.href value in the edit page to calculate an actual API URL.