vercel / serve-handler

The foundation of `serve`

Home Page:https://npmjs.com/serve-handler

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[feature request] wanna to add jsonp

songlairui opened this issue · comments

commented

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

with serve-handler

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