Skip to content

Commit

Permalink
Merge pull request #2 from DavidJinSuh90/main
Browse files Browse the repository at this point in the history
Final working project
  • Loading branch information
a-creation authored May 13, 2021
2 parents 1459c25 + 80245cf commit a459bdd
Show file tree
Hide file tree
Showing 92 changed files with 281 additions and 15,184 deletions.
Binary file modified .DS_Store
Binary file not shown.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules/
node_modules/
.vscode
10 changes: 5 additions & 5 deletions README.txt → README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ A real-time communication module for Deno.

server.ts:
```typescript
import { Sono } from 'https://deno.land/x/sono@v0.1.0/mod.ts';
import { Sono } from 'https://deno.land/x/sono@v1.0/mod.ts';

const sono = new Sono();
```

client.ts:
```typescript
import { SonoClient } from 'https://deno.land/x/sono@v0.1.0/mod.ts';
import { SonoClient } from 'https://deno.land/x/sono@v1.0/mod.ts';

const sono = new SonoClient('ws://localhost:8080/ws');

Expand All @@ -35,13 +35,13 @@ Import directly from deno.land / github.

deps.ts:
```typescript
import { Sono } from 'https://deno.land/x/sono@v0.1.0/mod.ts';
import { Sono } from 'https://deno.land/x/sono@v1.0/mod.ts';
```

## Documentation
Find the documentation [here.](https://linktodocumentation)
Find the documentation [here.](http://sono.land)

## Authors
## Authors

- [Chris Ejercito](https://github.com/chris-paul-ejercito)
- [David Suh](https://github.com/DavidJinSuh90)
Expand Down
70 changes: 0 additions & 70 deletions __test__/test.ts

This file was deleted.

13 changes: 0 additions & 13 deletions client_side/index.html

This file was deleted.

Empty file removed client_side/main.js
Empty file.
46 changes: 0 additions & 46 deletions client_side/server.ts

This file was deleted.

148 changes: 0 additions & 148 deletions client_side/sono_client.js

This file was deleted.

10 changes: 5 additions & 5 deletions deps.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/**
* Import and export necessary methods, types, and functions from the deno standard library.
*/
export { serve, Server as DenoServer, serveTLS, ServerRequest } from "https://deno.land/std@0.95.0/http/server.ts";
export { serveFile } from "https://deno.land/std@0.95.0/http/file_server.ts";
export type { HTTPOptions, HTTPSOptions } from "https://deno.land/std@0.95.0/http/server.ts";
export { acceptWebSocket, isWebSocketCloseEvent } from "https://deno.land/std@0.95.0/ws/mod.ts";
export type { WebSocket } from "https://deno.land/std@0.95.0/ws/mod.ts";
export { serve, Server as DenoServer, serveTLS, ServerRequest } from "https://deno.land/std@0.96.0/http/server.ts";
export { serveFile } from "https://deno.land/std@0.96.0/http/file_server.ts";
export type { HTTPOptions, HTTPSOptions } from "https://deno.land/std@0.96.0/http/server.ts";
export { acceptWebSocket, isWebSocketCloseEvent } from "https://deno.land/std@0.96.0/ws/mod.ts";
export type { WebSocket } from "https://deno.land/std@0.96.0/ws/mod.ts";
22 changes: 15 additions & 7 deletions websocket/server.ts → examples/webRTC/server.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import { serve } from "https://deno.land/std@0.95.0/http/server.ts";
import { serveFile } from "https://deno.land/std@0.95.0/http/file_server.ts";
import { TestSono } from "../mod.ts"
import { serve } from "https://deno.land/std@0.96.0/http/server.ts";
import { serveFile } from "https://deno.land/std@0.96.0/http/file_server.ts";
import { Sono } from "../../mod.ts"

const server = serve({ port: 8080 });
const sono = new TestSono();
const sono = new Sono();

sono.channel('secret', ()=> {console.log('secret opened')})

for await (const req of server) {

if (req.method === "GET" && req.url === "/") {
const path = `${Deno.cwd()}/static/index.html`
const content = await serveFile(req, path);
Expand All @@ -20,10 +21,17 @@ for await (const req of server) {
}
else if (req.method === "GET" && req.url === "/favicon.ico") {
// Do nothing in case of favicon request
continue;
}
else if (req.url === "/main.js") {
const path = `${Deno.cwd()}/static/main.js`

const content = await serveFile(req, path);
req.respond(content)
}
else {
const path = `${Deno.cwd()}/static/${req.url}`;
else if (req.method === "GET" && req.url === "/mod.ts"){
const path = `${Deno.cwd()}/../../mod.ts`;
const content = await serveFile(req, path);
req.respond(content)
}
}
}
Loading

0 comments on commit a459bdd

Please sign in to comment.