-
-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
_examples/basic: improvements and a how-to-run document for newcomers
- Loading branch information
Showing
3 changed files
with
62 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Basic Example | ||
|
||
## Requirements | ||
|
||
- [NPM](https://nodejs.org) | ||
- [Go Programming Language](https://golang.org/dl) | ||
|
||
## How to run | ||
|
||
Open a terminal window instance and execute: | ||
|
||
```sh | ||
$ cd ./browser | ||
# build the browser-side client: ./browser/bundle.js which ./browser/index.html imports. | ||
$ npm install && npm run-script build | ||
$ cd ../ # go back to ./basic | ||
$ go run main.go server # start the neffos websocket server. | ||
``` | ||
|
||
Open some web browser windows and navigate to <http://localhost:8080>, | ||
each window will ask for a username and a room to join, each window(client connection) and server get notified for namespace connected/disconnected, room joined/left and chat events. | ||
|
||
To start the go client side just open a new terminal window and execute: | ||
```sh | ||
$ go run main.go client | ||
``` | ||
|
||
It will ask you for username and a room to join as well, it acts exactly the same as the `./browser/app.js` browser-side application. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.