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

[feature request] wanna to add jsonp #134

Open
songlairui opened this issue Nov 8, 2020 · 1 comment
Open

[feature request] wanna to add jsonp #134

songlairui opened this issue Nov 8, 2020 · 1 comment

Comments

@songlairui
Copy link

songlairui commented Nov 8, 2020

how to
get /xxx.js?_callback=fn
return fn([js-file-data])

with serve-handler

@warren-bank
Copy link

shameless self-promotion alert:
this feature is available in my @warren-bank/serve fork of serve

demo:

  • here: set content-type response header
  • here: process request using a perl cgi-bin script
  • here: is the perl cgi-bin script
  • here: is the documentation for using cgi-bin scripts

fyi:

  • the --cors option injects response headers that will allow external websites to directly request static json resources

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

No branches or pull requests

2 participants