Skip to content

Commit

Permalink
sdk/js: implement flatend protocol in javascript
Browse files Browse the repository at this point in the history
  • Loading branch information
lithdew committed Jun 11, 2020
1 parent 6396f5a commit e8ed933
Show file tree
Hide file tree
Showing 7 changed files with 667 additions and 15 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.idea/
.idea/
**/node_modules/
10 changes: 3 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,9 @@ func handleGetTodos(ctx *flatend.Context) []byte {
}

func main() {
service := &flatend.Service{
Addr: "127.0.0.1:9000",
Services: map[string]flatend.Handler{
"all_todos": handleAllTodos,
"get_todos": handleGetTodos,
},
}
service := &flatend.Service{Addr: "127.0.0.1:9000"}
service.Register("all_todos", handleAllTodos)
service.Register("get_todos", handleGetTodos)
check(service.Start())
}
```
10 changes: 3 additions & 7 deletions cmd/microservice/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,8 @@ func handleGetTodos(ctx *flatend.Context) []byte {
}

func main() {
service := &flatend.Service{
Addr: "127.0.0.1:9000",
Services: map[string]flatend.Handler{
"all_todos": handleAllTodos,
"get_todos": handleGetTodos,
},
}
service := &flatend.Service{Addr: "127.0.0.1:9000"}
service.Register("all_todos", handleAllTodos)
service.Register("get_todos", handleGetTodos)
check(service.Start())
}
Loading

0 comments on commit e8ed933

Please sign in to comment.