Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/server Cleanup #14

Merged
merged 3 commits into from
May 4, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 26 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,30 @@ The socket connection endpoint is:
```
ws://{host:port}/v1.0/chat
```
Following are some examples for using Chrome/Dark Websocket.

The basic json format of a request is as follows:

```
{
"roomName":"Name of the room to access",
"reqType":999,
"content":"command, metadata, msg etc."
}
```

The basic json format of a response back from the server is as follows:

```
{
"roomName":"Name of the room responding.",
"rspType":999,
"content":"confirmation data, message, errors, etc"
"list":["data","in","array","form","such","as","roomnames"]
}
```
See server/chat_request.go and server/chat_response.go for more details on types.

The following are some examples for using Chrome/Dark Websocket.
Spaces must be encoded in JSON calls.

```
Expand Down Expand Up @@ -124,8 +147,8 @@ Spaces must be encoded in JSON calls.

```

A client javascript/html demo is provided under the /client directory.
Please see that directories README.md for more information.
Clientside demos are provided under the /client directory.
Please see those directory README.md files for more information.

## HTTP API for Alive and Stats

Expand Down
35 changes: 2 additions & 33 deletions client/README.md
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,34 +1,3 @@
## ChattyPantz Client Demo
## ChattyPantz Client Demos

This folder contains a simple demonstration of a client connection to the server using javascript and html.

### Dependencies

* You must be connected to the internet to load CDN angular.js, semnatic-ui.js, and jquery.js.
* The server should be running on localhost:6660

### Instructions

Assumption: server is up and running on localhost:6660.

If needed, you can change the API host and port endpoint in scripts/services/api.js:
```
var server = "ws://127.0.0.1:6660/v1.0/chat";
```
1. Load app/index.html in your browser.
2. Enter a nickname.
3. Connect to the server.

You will be placed into room "Demo". A list of user nicknames from the room will also be displayed.
NOTE: If your nickname already exists when logging into the room, you will be warned and disconnected.

4. Now, send your messages.
5. When you are done, disconnect from the server.

### Enhancements

The application doesn't demonstrate multi-room management, nor does it demonstrate the following request types:
* GET_NICKNAME: 102
* LIST_ROOMS: 103
* HIDE: 106
* UNHIDE: 107
Subfolders in this directory demonstrate client side connections to the Chattypantz server.
34 changes: 34 additions & 0 deletions client/angular/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
## ChattyPantz Client Demo - Angular.js

This folder contains a simple demonstration of a client connection to the server using javascript and html.

### Dependencies

* You must be connected to the internet to load CDN angular.js, semnatic-ui.js, and jquery.js.
* The server should be running on localhost:6660

### Instructions

Assumption: server is up and running on localhost:6660.

If needed, you can change the API host and port endpoint in scripts/services/api.js:
```
var server = "ws://127.0.0.1:6660/v1.0/chat";
```
1. Load app/index.html in your browser.
2. Enter a nickname.
3. Connect to the server.

You will be placed into room "Demo". A list of user nicknames from the room will also be displayed.
NOTE: If your nickname already exists when logging into the room, you will be warned and disconnected.

4. Now, send your messages.
5. When you are done, disconnect from the server.

### Enhancements

The application doesn't demonstrate multi-room management, nor does it demonstrate the following request types:
* GET_NICKNAME: 102
* LIST_ROOMS: 103
* HIDE: 106
* UNHIDE: 107
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.