Skip to content

Commit

Permalink
add install guide
Browse files Browse the repository at this point in the history
  • Loading branch information
asim committed Mar 3, 2022
1 parent 87365ff commit c8ab913
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ A collection of docs, guides and resources for M3O

- [Getting Started](getting-started.md)
- [Client Libraries](client-libraries.md)
- [Install Guide](install.md)
- [Architecture](architecture.md)
- [Roadmap](roadmap.md)
- [Resources](#resources)
Expand Down
84 changes: 84 additions & 0 deletions docs/install.md
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)
}
```

0 comments on commit c8ab913

Please sign in to comment.