diff --git a/app/client/ui/Tools.ts b/app/client/ui/Tools.ts index 1ca56d8f..26a85638 100644 --- a/app/client/ui/Tools.ts +++ b/app/client/ui/Tools.ts @@ -100,6 +100,17 @@ export function tools(owner: Disposable, gristDoc: GristDoc, leftPanelOpen: Obse testId('settings'), ), cssSpacer(), + // TODO make this look nice, then make it visible when the console is ready. + // For now let's keep it private, so this shouldn't be uncommented. + // cssPageEntry( + // cssPageLink( + // cssPageIcon('Code'), + // cssPageIcon('FieldLink'), + // cssLinkText(t("API Console")), + // {href: window.origin + '/apiconsole', target: '_blank'} + // ), + // testId('api'), + // ), dom.maybe(docPageModel.currentDoc, (doc) => { const ex = buildExamples().find(e => e.urlId === doc.urlId); if (!ex || !ex.tutorialUrl) { return null; } diff --git a/app/server/lib/AppEndpoint.ts b/app/server/lib/AppEndpoint.ts index 4f40ada7..313d8ce3 100644 --- a/app/server/lib/AppEndpoint.ts +++ b/app/server/lib/AppEndpoint.ts @@ -44,6 +44,9 @@ export function attachAppEndpoint(options: AttachOptions): void { app.get(['/', '/ws/:wsId', '/p/:page'], ...middleware, expressWrap(async (req, res) => sendAppPage(req, res, {path: 'app.html', status: 200, config: {plugins}, googleTagManager: 'anon'}))); + app.get('/apiconsole', expressWrap(async (req, res) => + sendAppPage(req, res, {path: 'apiconsole.html', status: 200, config: {}}))); + app.get('/api/worker/:assignmentId([^/]+)/?*', expressWrap(async (req, res) => { if (!useWorkerPool()) { // Let the client know there is not a separate pool of workers, diff --git a/static/apiconsole.html b/static/apiconsole.html new file mode 100644 index 00000000..9191d3c5 --- /dev/null +++ b/static/apiconsole.html @@ -0,0 +1,220 @@ + + + + + + + Grist API Console + + + + +
+ + + +