'docs/readme.md' güncelle

This commit is contained in:
saqut 2022-12-19 19:22:48 +01:00
parent 08375999dd
commit 9288e2d567
1 changed files with 27 additions and 1 deletions

View File

@ -1 +1,27 @@
İlk commit ## Kurulum
Proje ortamına kurulumu
```html
<script src="https://ws.saqut.com/script"></script>
```
Geliştirme ortamına kurulumu
```javascript
const wsjs = new MWSE({
endpoint: "https://ws.saqut.com/" // Bağlanılacak sunucuyu belirtir
});
wsjs.scope(async () => {
// Bağlantı sağlandığında burası tetiklenir
})
```
Kendi bağlantı kimliğini öğrenme
```
wsjs.scope(async () => {
let me = wsjs.peer('me'); // kendimizden bahsederken 'me' anahtar kelimesini kullanırız
console.log(me.socketId); // her peerin socketId'si olması gerekir
})
```