An open API service indexing awesome lists of open source software.

https://github.com/udamir/magx-examples

Basic examples of how to use magx, mosx and magx-client
https://github.com/udamir/magx-examples

examples magx mosx

Last synced: 11 months ago
JSON representation

Basic examples of how to use magx, mosx and magx-client

Awesome Lists containing this project

README

          

# Magx examples project

On this repository you can find basic and advanced examples of how to use [magx](https://github.com/udamir/magx/), [mosx](https://github.com/udamir/mosx/) and [magx-client](https://github.com/udamir/magx-client/).

## How to run
```
git clone https://github.com/udamir/magx-examples.git
cd magx-examples
npm install
npm start
```

Open http://localhost:3001 in your browser.

## Examples overview

While running the server following examples are avaliable:

### Basic examples

[Chat](http://localhost:3001/basic/chat.html) - Example of simple without state

[Mosx-state](http://localhost:3001/basic/mosx-state.html) - Example shows how to use [Mosx](https://github.com/udamir/mosx/) as your room's state

[Reconnection](http://localhost:3001/basic/reconnection.html) - This example shows how to enable client's reconnection

[Lobby room](http://localhost:3001/basic/lobby.html) - This example shows how to use LobbyRoom

[Relay room](http://localhost:3001/basic/relay.html) - This example shows how to create relay server

### Advanced examples

[Snake game](http://localhost:3001/advanced/snake.html) - Example of simple game (snake)

[Magx chat](http://localhost:3001/advanced/mosx-chat/index.html) - One room chat with private messages. This example shows how to create and manage private objects in Mosx state

[Open world](http://localhost:3001/advanced/mosx-open-world.html) - This example shows how Magx and Mosx can be used for open world games.

### Tools
[Monitoring](http://localhost:3001/magx/monitor) - Monitoring console to view rooms and state of your server

### Scalability
Examples project can be run in cluster mode:
```
npm run cluster
```

or via pm2 (redis and mongodb required):
```
npm run pm2
```

## License
MIT