Skip to content

Commit 452122f

Browse files
committed
use local server by default in demo
1 parent b7781bf commit 452122f

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ npm install
7777
npm run dev
7878
```
7979

80-
Requires a running Redis instance (or use `docker compose up redis`).
80+
Requires a running Redis instance (or use `docker compose up redis`). Or use `docker compose -f docker-compose.dev.yml up` to run the app in a container.
8181

8282
### Testing
8383

docker-compose.dev.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
services:
22
app:
3-
build: .
3+
image: node:22-alpine
4+
working_dir: /app
5+
volumes:
6+
- .:/app
47
ports:
58
- "3000:3000"
69
environment:
710
- REDIS_URL=redis://redis:6379
811
- PORT=3000
912
- CORS_ORIGIN=*
1013
- TRUST_PROXY=1
14+
command: sh -c "npm install && npm run dev"
1115
depends_on:
1216
- redis
1317
restart: unless-stopped

src/routes/home.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ router.get("/", (req, res) => {
1313
<meta charset="UTF-8">
1414
<meta name="viewport" content="width=device-width, initial-scale=1.0">
1515
<title>Applause Button Server</title>
16+
<link rel="stylesheet" href="https://unpkg.com/applause-button/dist/applause-button.css" />
17+
<script src="https://unpkg.com/applause-button/dist/applause-button.js"></script>
1618
<style>
1719
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
1820
body {
@@ -57,7 +59,7 @@ router.get("/", (req, res) => {
5759
5860
<div class="demo">
5961
<p>Try it out:</p>
60-
<applause-button style="width: 58px; height: 58px;" url="${baseUrl}/demo" />
62+
<applause-button style="width: 58px; height: 58px;" api="${baseUrl}" url="${baseUrl}/demo2" />
6163
</div>
6264
6365
<h2>Usage</h2>
@@ -83,11 +85,6 @@ router.get("/", (req, res) => {
8385
</p>
8486
</div>
8587
86-
<link rel="stylesheet" href="https://unpkg.com/applause-button/dist/applause-button.css" />
87-
<script src="https://unpkg.com/applause-button/dist/applause-button.js"></script>
88-
<script>
89-
document.querySelector("applause-button").setAttribute("api", "${baseUrl}");
90-
</script>
9188
</body>
9289
</html>`);
9390
});

0 commit comments

Comments
 (0)