diff --git a/.gitignore b/.gitignore index a14702c..f890f5a 100644 --- a/.gitignore +++ b/.gitignore @@ -32,3 +32,6 @@ report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json # Finder (MacOS) folder config .DS_Store + +# SSL certificates +ssl/ diff --git a/bun.lock b/bun.lock index 962d0e1..4b014f7 100644 --- a/bun.lock +++ b/bun.lock @@ -1,26 +1,23 @@ { "lockfileVersion": 1, + "configVersion": 0, "workspaces": { "": { "name": "test-web-push", "devDependencies": { - "@types/bun": "latest", + "@types/bun": "1.3.6", }, "peerDependencies": { - "typescript": "^5", + "typescript": "^5.9.3", }, }, }, "packages": { - "@types/bun": ["@types/bun@1.2.21", "", { "dependencies": { "bun-types": "1.2.21" } }, "sha512-NiDnvEqmbfQ6dmZ3EeUO577s4P5bf4HCTXtI6trMc6f6RzirY5IrF3aIookuSpyslFzrnvv2lmEWv5HyC1X79A=="], + "@types/bun": ["@types/bun@1.3.6", "", { "dependencies": { "bun-types": "1.3.6" } }, "sha512-uWCv6FO/8LcpREhenN1d1b6fcspAB+cefwD7uti8C8VffIv0Um08TKMn98FynpTiU38+y2dUO55T11NgDt8VAA=="], "@types/node": ["@types/node@24.3.0", "", { "dependencies": { "undici-types": "~7.10.0" } }, "sha512-aPTXCrfwnDLj4VvXrm+UUCQjNEvJgNA8s5F1cvwQU+3KNltTOkBm1j30uNLyqqPNe7gE3KFzImYoZEfLhp4Yow=="], - "@types/react": ["@types/react@19.1.12", "", { "dependencies": { "csstype": "^3.0.2" } }, "sha512-cMoR+FoAf/Jyq6+Df2/Z41jISvGZZ2eTlnsaJRptmZ76Caldwy1odD4xTr/gNV9VLj0AWgg/nmkevIyUfIIq5w=="], - - "bun-types": ["bun-types@1.2.21", "", { "dependencies": { "@types/node": "*" }, "peerDependencies": { "@types/react": "^19" } }, "sha512-sa2Tj77Ijc/NTLS0/Odjq/qngmEPZfbfnOERi0KRUYhT9R8M4VBioWVmMWE5GrYbKMc+5lVybXygLdibHaqVqw=="], - - "csstype": ["csstype@3.1.3", "", {}, "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw=="], + "bun-types": ["bun-types@1.3.6", "", { "dependencies": { "@types/node": "*" } }, "sha512-OlFwHcnNV99r//9v5IIOgQ9Uk37gZqrNMCcqEaExdkVq3Avwqok1bJFmvGMCkCE0FqzdY8VMOZpfpR3lwI+CsQ=="], "typescript": ["typescript@5.9.2", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A=="], diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..8fdad34 --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1767116409, + "narHash": "sha256-5vKw92l1GyTnjoLzEagJy5V5mDFck72LiQWZSOnSicw=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "cad22e7d996aea55ecab064e84834289143e44a0", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..220701c --- /dev/null +++ b/flake.nix @@ -0,0 +1,21 @@ +{ + description = "DropUI Django"; + + inputs.nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; + + outputs = { self, nixpkgs, ... }: let + system = "x86_64-linux"; + pkgs = import nixpkgs { + inherit system; + config.allowUnfree = true; + }; + in { + devShells.${system}.default = pkgs.mkShell { + buildInputs = with pkgs; [ + bun + biome + google-chrome + ]; + }; + }; +} diff --git a/index.html b/index.html index a7d19c4..6801217 100644 --- a/index.html +++ b/index.html @@ -1,17 +1,19 @@ - + - - - - Test Web Push - - - -
-

🚀 Test Web Push

-

Ultra prosta strona do testowania Web Push notyfikacji

-
- - - + + + + Test Web Push + + + + +
+

🚀 Test Web Push

+

Ultra prosta strona do testowania Web Push notyfikacji

+
+ diff --git a/package.json b/package.json index 7fca4f6..fd87f0d 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "start": "bun run dev" }, "devDependencies": { - "@types/bun": "latest" + "@types/bun": "1.3.6" }, "peerDependencies": { "typescript": "^5.9.2" diff --git a/server.ts b/server.ts index 050abb6..cfb69dd 100644 --- a/server.ts +++ b/server.ts @@ -29,6 +29,12 @@ function getMimeType(filename: string): string { const server = Bun.serve({ port: 5173, + + // tls: { + // key: Bun.file("./ssl/key.pem"), + // cert: Bun.file("./ssl/cert.pem"), + // }, + async fetch(req) { const url = new URL(req.url); const pathname = url.pathname; diff --git a/sw.js b/sw.js index 75189f6..cfd459a 100644 --- a/sw.js +++ b/sw.js @@ -1,5 +1,6 @@ // sw.js console.log("Service Worker loaded"); + importScripts( - "http://localhost:8000/campaigns/webpush/sw-core/4c9eb80b-a074-45b2-8f15-397c1f7696da.js", + "http://localhost:8000/api/v1/webpush/public/integrations/7b35f08f-49d6-48f9-a830-f3654008dce5/sw.js", );