mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) API console
Summary: Adds a custom interactive Swagger API console at `/apiconsole`. For now, this isn't visibly linked anywhere. Test Plan: Manual, this is still an experimental and private feature. The idea is to merge this soon so that we have a chance to try it out in production. Reviewers: georgegevoian Reviewed By: georgegevoian Differential Revision: https://phab.getgrist.com/D4151
This commit is contained in:
@@ -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; }
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user