Skip to content

Commit

Permalink
add static server for javascript example
Browse files Browse the repository at this point in the history
  • Loading branch information
Terry-Mao committed Sep 14, 2015
1 parent a5f0f2a commit 69e5add
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
8 changes: 2 additions & 6 deletions README_cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,20 +64,16 @@ $ go get ./...
```sh
$ cd $GOPATH/src/github.com/Terry-Mao/goim/router
$ go install
$ cp message-example.conf $GOPATH/bin/router.conf
$ cp log.xml $GOPATH/bin/router_log.xml
$ cp router-example.conf $GOPATH/bin/router.conf
$ cd ../logic/
$ go install
$ cp logic-example.conf $GOPATH/bin/logic.conf
$ cp log.xml $GOPATH/bin/logic_log.xml
$ cd ../comet/
$ go install
$ cp comet-example.conf $GOPATH/bin/comet.conf
$ cp log.xml $GOPATH/bin/comet_log.xml
$ cd ../logic/job/
$ go install
$ cp job-example.conf $GOPATH/bin/job.conf
$ cp log.xml $GOPATH/bin/job_log.xml
```
到此所有的环境都搭建完成!

Expand All @@ -101,7 +97,7 @@ TODO

## 例子

Websocket: [Websocket Client Demo](https://github.com/Terry-Mao/goim/tree/master/client-example)
Websocket: [Websocket Client Demo](https://github.com/Terry-Mao/goim/tree/master/examples/javascript)

## 文档
[push http协议文档](https://github.com/Terry-Mao/goim/blob/master/doc/push.md)推送接口
Expand Down
3 changes: 2 additions & 1 deletion doc/push.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ push http接口文档,用于推送接口接入
* 请求例子

```sh
curl -d "{\"test\":1}" http://127.0.0.1:7172/1/push
# uid 表示推送的用户?uid=0
curl -d "{\"test\":1}" http://127.0.0.1:7172/1/push?uid=0
```

* 返回
Expand Down
11 changes: 11 additions & 0 deletions examples/javascript/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package main

import (
"log"
"net/http"
)

func main() {
// Simple static webserver:
log.Fatal(http.ListenAndServe(":1999", http.FileServer(http.Dir("./"))))
}

0 comments on commit 69e5add

Please sign in to comment.