blob: ec92fc2ff40a5a95f199bbe8025292965f5f8d69 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
# JCHAT Web Client
A pure HTML/JavaScript client for the JCHAT protocol. No build process required - just serve the static files.
## Quick Start
### Option 1: Using shttpd (recommended)
```bash
shttpd . --port 3000
```
### Option 2: Using Python
```bash
python3 -m http.server 3000
```
### Option 3: Using any web server
Point your web server (nginx, Apache, etc.) to serve files from this directory.
## Files
- `index.html` - Main client interface
- `jmap-client.js` - JMAP protocol client library
- `app.js` - Chat application logic
- `package.json` - Project metadata (no dependencies)
## Usage
1. Make sure the JCHAT server is running on `localhost:8080`
2. Serve these files on any port (e.g., 3000)
3. Open `http://localhost:3000` in your browser
4. The client will automatically connect to the JCHAT server
## Configuration
The client connects to `http://localhost:8080` by default. To change this, edit the `serverUrl` in `app.js`:
```javascript
class JChatApp {
constructor() {
this.jmapClient = new JMAPClient('http://your-server:8080');
// ...
}
}
```
## Browser Support
Works in any modern browser that supports:
- ES6 Classes
- Fetch API
- Arrow functions
- Template literals
## No Build Required
This is intentionally a simple, dependency-free client. No webpack, no npm install, no build process. Just HTML, CSS, and vanilla JavaScript.
|