This commit is contained in:
ennmichael
2023-04-09 19:12:49 +02:00
parent 31b0538337
commit 3ffe4d5b19
7 changed files with 94 additions and 9 deletions

View File

@ -7,6 +7,21 @@
<link rel="stylesheet" href="https://unpkg.com/mocha/mocha.css" />
</head>
<body>
<div style="margin-left: 5px; margin-top: 15px">
<a style="color: var(--mocha-color)" id="window.nostr"></a>
</div>
<script>
const a = document.getElementById("window.nostr")
if (window.location.pathname === "/nostr-object") {
a.href = "/"
a.innerHTML = "disable window.nostr"
} else {
a.href = "/nostr-object"
a.innerHTML = "enable window.nostr"
}
</script>
<div id="mocha"></div>
<script src="https://unpkg.com/mocha/mocha.js"></script>
@ -15,6 +30,7 @@
mocha.setup({
ui: "bdd",
timeout: "5s",
global: ["nostr"],
})
mocha.checkLeaks()
</script>

View File

@ -10,7 +10,7 @@ const port = 33543
const app = express()
app.use("/", (req: express.Request, res: express.Response) => {
if (req.path === "/") {
if (req.path === "/" || req.path === "/nostr-object") {
const index = fs.readFileSync(path.join(__dirname, "index.html"), {
encoding: "utf8",
})