Skip to content

Commit d085053

Browse files
committed
Add more examples to documentation
1 parent de9b463 commit d085053

File tree

3 files changed

+57
-1
lines changed

3 files changed

+57
-1
lines changed

website/docs/local.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
id: local
3+
title: Local connection
4+
sidebar_label: Local connection
5+
---
6+
7+
## Example
8+
9+
In the repository root directory you can find some simple examples. Click [here for local connection example](https://github.com/vardius/peer-data/tree/master/examples/local-connection).
10+
11+
This simple project demonstrates how to setup WebRTC connection using [peer-data](https://github.com/vardius/peer-data) and custom signalling channel instead of builtin [SocketChannel](https://github.com/vardius/peer-data/blob/master/src/app/SocketChannel.ts).
12+
13+
To run this example simple clone the repository and perform the following from the root directory:
14+
15+
```sh
16+
➜ examples git:(master) ✗ cd local-connection
17+
➜ local-connection git:(master) ✗ yarn
18+
yarn install v1.22.1
19+
[1/4] 🔍 Resolving packages...
20+
success Already up-to-date.
21+
✨ Done in 0.13s.
22+
➜ local-connection git:(master) ✗ yarn start
23+
yarn run v1.22.1
24+
$ node server.js
25+
Server started at port 3000
26+
```
27+
28+
Then open [http://localhost:3000/](http://localhost:3000/).

website/docs/socket.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
id: socket
3+
title: Socket signalling channel
4+
sidebar_label: Socket signalling channel
5+
---
6+
7+
## Example
8+
9+
In the repository root directory you can find some simple examples. Click [here for socket signalling channel example](https://github.com/vardius/peer-data/tree/master/examples/socket-channel).
10+
11+
This simple project demonstrates how to setup WebRTC connection using [peer-data](https://github.com/vardius/peer-data) and socket signalling channel.
12+
13+
To run this example simple clone the repository and perform the following from the root directory:
14+
15+
```sh
16+
➜ examples git:(master) ✗ cd socket-channel
17+
➜ socket-channel git:(master) ✗ yarn
18+
yarn install v1.22.1
19+
[1/4] 🔍 Resolving packages...
20+
success Already up-to-date.
21+
✨ Done in 0.13s.
22+
➜ socket-channel git:(master) ✗ yarn start
23+
yarn run v1.22.1
24+
$ node server.js
25+
Server started at port 3000
26+
```
27+
28+
Then open [http://localhost:3000/](http://localhost:3000/).

website/src/sidebars.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
"docs": {
33
"Quick Start": ["installation", "client", "signaling"],
44
"Connection": ["data-channel", "media-stream"],
5-
"Examples": ["error"]
5+
"Examples": ["error", "local", "socket"]
66
}
77
}

0 commit comments

Comments
 (0)