File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 33require ( 'es6-promise' ) . polyfill ( ) ;
44require ( 'isomorphic-fetch' ) ;
55
6- var sendStats = function ( sitekey , data ) {
6+ var sendStats = function ( apiHostname , sitekey , data ) {
77
88 // Beacon in browsers
99 if ( typeof window !== 'undefined' && window . navigator && window . navigator . sendBeacon ) {
10- navigator . sendBeacon ( 'https://api.addsearch.com /v1/stats/' + sitekey + '/' , JSON . stringify ( data ) ) ;
10+ navigator . sendBeacon ( 'https://' + apiHostname + ' /v1/stats/' + sitekey + '/' , JSON . stringify ( data ) ) ;
1111 }
1212
1313 // POST in node
1414 else {
15- fetch ( 'https://api.addsearch.com /v1/stats/' + sitekey + '/' , {
15+ fetch ( 'https://' + apiHostname + ' /v1/stats/' + sitekey + '/' , {
1616 method : 'POST' ,
1717 headers : {
1818 'Content-Type' : 'text/plain' ,
You can’t perform that action at this time.
0 commit comments