summaryrefslogtreecommitdiffstats
path: root/src/webenginewidgets/doc/snippets
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@qt.io>2022-09-27 17:41:24 +0200
committerMichal Klocek <michal.klocek@qt.io>2022-11-29 18:32:35 +0100
commit414cc4d81f5aaefd5dc2ad4d14de6c3fcd0730d4 (patch)
treef4e0195706da586a58bebda4be8e8c2a80c806ea /src/webenginewidgets/doc/snippets
parentc036fa3ead32ab27d600e824e042dad18818b4af (diff)
Add push notification example
Adds simple push service implementation in NodeJS. Note setup for endpoint for qwebenginepage is not mentioned as it has to be decided what to do with it (see bug report). Task-number: QTBUG-107442 Change-Id: Iacfcb2a9d0c33c514b4046d06f866eb82390a240 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/webenginewidgets/doc/snippets')
-rw-r--r--src/webenginewidgets/doc/snippets/push_notifications/commands19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/webenginewidgets/doc/snippets/push_notifications/commands b/src/webenginewidgets/doc/snippets/push_notifications/commands
new file mode 100644
index 000000000..aee9761c1
--- /dev/null
+++ b/src/webenginewidgets/doc/snippets/push_notifications/commands
@@ -0,0 +1,19 @@
+// Copyright (C) 2022 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+//! [0]
+npm init -y
+npm install web-push express
+//! [0]
+
+//! [1]
+"start": "node server.js"
+//! [1]
+
+//! [2]
+./node_odules/.bin/web-push generate-vapid-keys
+//! [2]
+
+//! [3]
+npm start
+//! [3]