0.2.0 • Published 7 years ago

sugarit v0.2.0

Weekly downloads
2
License
GPL-3.0
Repository
github
Last release
7 years ago

sugarit

NPM

sugarit is a easy use server

quickstart

register your app in ./config/settings.json

{
    "gate":[
        {"name":"mygate"}
    ]
}

create your application in app dir
mkdir /app/{yourapp}
write your logic in index.js and export it, just like:

export function hello(channel){
    channel.send({"response": "hello world"})
}

start your server now

import Sugar from 'sugarit'
const server = new Sugar()
server.start()

finnnaly, call it by socketio socket.emit({yourapp}.hello)
see more detail in ./example

usage

channel

send

@param message {object}
send it to client

set

@param key {string}
@param value {any} set a value to global session

get

@param key {string}
get a value by key from global session

session

just like a object, it is a local variable, could not read it from a another process

troubleshooting

issuse: https://github.com/zurex/sugar/issues

0.2.0

7 years ago

0.1.14

7 years ago

0.1.13

7 years ago

0.1.12

7 years ago

0.1.11

7 years ago

0.1.10

7 years ago

0.1.9

7 years ago

0.1.8

7 years ago

0.1.7

7 years ago

0.1.6

7 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago