-
Notifications
You must be signed in to change notification settings - Fork 1.1k
[WIP]feat: add local API Explorer #1976
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| // openApiSpecUrl, | ||
| // ); | ||
| // writeFileSync(explorerIndexFilePath, templateContent); | ||
| app.static(explorerPath, explorerLocalPath); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bajtos app.static seems to be overriding the ExplorerController . Any idea what's going on? Or did I misunderstand something?
5c07876 to
53f9056
Compare
| .expect(content); | ||
| }); | ||
|
|
||
| it('gives precedence to API controllers over static assets', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bajtos here is the test which catches the problem. Calling restApp.static('/html', root); after restApp.controller(DummyController); passes the test. That means, something's wrong in the order of registration /look up.
|
@hacksparrow Please rebase this PR off master. |
e6b93aa to
f45e4e3
Compare
|
Notes on the current state of the PR
options.enableExplorer = true;
options.explorerPath = '/explorer1';
|
Add local API Explorer
f45e4e3 to
6618cd0
Compare
I would personally prefer a slightly different configuration:
I feel that removing this feature would be a breaking change that requires semver-major. Are we ok with publishing IMO, a better solution is to introduce a configuration flag allowing applications to disable this built-in redirect. When the Explorer component is mounted, it can set this flag to |
|
I opened a new PR inspired by this work, see #2014 |
Add local API Explorer
Checklist
npm testpasses on your machinepackages/cliwere updatedexamples/*were updated