-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
85 additions
and
0 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
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,84 @@ | ||
# Install Guide | ||
|
||
Here's a quick guide to installing M3O | ||
|
||
## Clients | ||
|
||
- [cli](#cli) - install script for the [m3o-cli](https://github.com/m3o/m3o-cli) | ||
- [js](#js) - install the [m3o-js](https://github.com/m3o/m3o-js) client | ||
- [go](#go) - install the [m3o-go](https://github.com/m3o/m3o-go) client | ||
|
||
### CLI | ||
|
||
Install the m3o cli | ||
|
||
```sh | ||
## follow the instructions | ||
curl -fssl https://install.m3o.com/cli | /bin/bash | ||
``` | ||
|
||
To use the helloworld service | ||
|
||
``` | ||
export M3O_API_TOKEN=xxxx | ||
m3o helloworld call --name=Alice | ||
``` | ||
|
||
### Javascript | ||
|
||
Install the m3o js client | ||
|
||
```bash | ||
npm install m3o | ||
``` | ||
|
||
To use the helloworld service | ||
|
||
```js | ||
const { HelloworldService } = require("m3o/helloworld"); | ||
|
||
const helloworldService = new HelloworldService(process.env.M3O_API_TOKEN); | ||
|
||
// Call returns a personalised "Hello $name" response | ||
async function callTheHelloworldService() { | ||
const rsp = await helloworldService.call({ | ||
name: "Alice", | ||
}); | ||
console.log(rsp); | ||
} | ||
|
||
callTheHelloworldService(); | ||
``` | ||
|
||
### Go | ||
|
||
Install the m3o go client | ||
|
||
```bash | ||
go get go.m3o.com | ||
``` | ||
|
||
To use the helloworld service | ||
|
||
```go | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
|
||
"go.m3o.com/helloworld" | ||
) | ||
|
||
function main() { | ||
helloworldService := helloworld.NewHelloworldService(os.Getenv("M3O_API_TOKEN")) | ||
|
||
rsp, err := helloworldService.Call(&helloworld.CallRequest{ | ||
"Name": "Alice", | ||
}) | ||
|
||
fmt.Println(rsp.Message) | ||
} | ||
``` | ||
|