aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/lib/bug-notifier.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/scripts/lib/bug-notifier.js')
-rw-r--r--app/scripts/lib/bug-notifier.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/app/scripts/lib/bug-notifier.js b/app/scripts/lib/bug-notifier.js
new file mode 100644
index 000000000..4d305b894
--- /dev/null
+++ b/app/scripts/lib/bug-notifier.js
@@ -0,0 +1,22 @@
+class BugNotifier {
+ notify (uri, message) {
+ return postData(uri, message)
+ }
+}
+
+function postData(uri, data) {
+ return fetch(uri, {
+ body: JSON.stringify(data), // must match 'Content-Type' header
+ credentials: 'same-origin', // include, same-origin, *omit
+ headers: {
+ 'content-type': 'application/json',
+ },
+ method: 'POST', // *GET, POST, PUT, DELETE, etc.
+ mode: 'cors', // no-cors, cors, *same-origin
+ })
+}
+
+const notifier = new BugNotifier()
+
+module.exports = notifier
+