-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Created new endpoint for loading test pages in an iframe. #7615
Conversation
build-system/server.js
Outdated
// Nest the response in an iframe. | ||
// Example: | ||
// http://localhost:8000/iframe/examples/ads.amp.max.html | ||
app.use('/iframe/', function(req, res) { |
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.
i guess you need to strip out the leading '/iframe/'? you can do that by
also, use app.get
instead of app.use
build-system/server.js
Outdated
@@ -251,6 +251,16 @@ function proxyToAmpProxy(req, res, minify) { | |||
}); | |||
} | |||
|
|||
// Returns an html blob with an iframe pointing to the provided url. | |||
function nestResponseInIframe(url) { |
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.
to save space from this rapid growing file, let's just inline this function.
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.
awesome! thanks
…#7615) * Created new endpoint for loading test pages in an iframe. * Inlined function * Changed .use to .get
It is becoming increasingly common to want to run example pages within an iframe. Instead of redoing ever test and making N duplicates, I have added an endpoint to the test server, /iframe/, that allows you to load any page inside of an iframe.