You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+73Lines changed: 73 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,6 +31,79 @@ Stream data through multiple QRCodes
31
31
32
32
[Live demo](https://qrss.netlify.app/)
33
33
34
+
## Build & run
35
+
36
+
**1. Install Dependencies**
37
+
38
+
You need install [Node.js](https://nodejs.org) first.The project uses `pnpm` as its package manager. First, ensure you have `pnpm` installed:
39
+
40
+
```bash
41
+
npm install -g pnpm
42
+
```
43
+
44
+
Then, install the project dependencies:
45
+
46
+
```bash
47
+
pnpm install
48
+
```
49
+
50
+
**2. Build the Project**
51
+
52
+
Build the project using the command specified in the `package.json` and `netlify.toml`:
53
+
54
+
```bash
55
+
pnpm run build
56
+
```
57
+
58
+
This will generate the output in the `.output` directory.
59
+
60
+
Alternatively, if you want to run the development server to test changes:
61
+
62
+
```bash
63
+
pnpm run dev
64
+
```
65
+
66
+
**3. Serve the Project Locally**
67
+
68
+
if your target environment have `Node.js`, you can copy entire `.output` directory to where you want.You can preview this build using:
69
+
70
+
```bash
71
+
node .output/server/index.mjs
72
+
```
73
+
74
+
if your target environment don't have `Node.js`, you cat just host those static files.
75
+
76
+
```bash
77
+
cd .output/public
78
+
python -m http.server
79
+
```
80
+
81
+
You will usually encounter the following errors.
82
+
83
+
```
84
+
Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/plain". Strict MIME type checking is enforced for module scripts per HTML spec.
85
+
```
86
+
87
+
you need a custom web server, Run in the `.output/public` directory:
88
+
89
+
```python
90
+
# python custom_http_server.py
91
+
from http.server import SimpleHTTPRequestHandler, HTTPServer
92
+
93
+
classCustomHandler(SimpleHTTPRequestHandler):
94
+
defend_headers(self):
95
+
self.extensions_map.update({
96
+
".js": "application/javascript",
97
+
})
98
+
super().end_headers()
99
+
100
+
ADDR='0.0.0.0'
101
+
PORT=8000
102
+
with HTTPServer((ADDR, PORT), CustomHandler) as httpd:
103
+
print(f"Serving on http://{ADDR}:{PORT}")
104
+
httpd.serve_forever()
105
+
```
106
+
34
107
## Sub-packages
35
108
36
109
-[QiFi CLI](./packages/cli) - CLI for streaming QR code file transmission
0 commit comments