Skip to content
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

added embedded API Viewer #822

Merged
merged 5 commits into from
Apr 20, 2016
Merged

added embedded API Viewer #822

merged 5 commits into from
Apr 20, 2016

Conversation

daspilker
Copy link
Member

No description provided.

if (path == '/api-viewer') {
response.sendRedirect("${request.requestURI}/index.html")
} else if (path == '/api-viewer/build/data/update-center.jsonp') {
JSONObject data = Jenkins.instance.updateCenter.getById(ID_DEFAULT).JSONObject
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to add

response.setContentType('application/javascript')

here to get this to work. I was getting:

Refused to execute script from 'http://localhost:8080/plugin/job-dsl/api-viewer/build/data/update-center.jsonp' because its MIME type ('') is not executable, and strict MIME type checking is enabled.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the hint. I want to get rid of the JSONP stuff. Maybe the JSONP can be processed in Gradle or Grunt to remove the padding. But that's another PR.

@sheehan
Copy link
Contributor

sheehan commented Apr 19, 2016

Very cool!

@daspilker
Copy link
Member Author

@sheehan yes it is! Thanks to your single page app design! I did not expect that it will be so easy.

@daspilker daspilker merged commit 0382fdf into jenkinsci:master Apr 20, 2016
@daspilker daspilker deleted the api-viewer branch April 20, 2016 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants