Skip to content

Commit

Permalink
Commit from m3o/m3o action
Browse files Browse the repository at this point in the history
  • Loading branch information
m3o-actions committed Jun 20, 2023
1 parent 12c0938 commit 97c3604
Show file tree
Hide file tree
Showing 26 changed files with 1,040 additions and 1,040 deletions.
46 changes: 23 additions & 23 deletions examples/ai/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,6 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/Ai/api](https:

Endpoints:

## Complete

Make a request to the AI


[https://m3o.com/ai/api#Complete](https://m3o.com/ai/api#Complete)

```js
const { AiService } = require('m3o/ai');

const aiService = new AiService(process.env.M3O_API_TOKEN)

// Make a request to the AI
async function completeTheText() {
const rsp = await aiService.complete({
"text": "who is leonardo davinci"
})
console.log(rsp)

}

completeTheText()
```
## Edit

Edit or edit prompt/code
Expand Down Expand Up @@ -120,3 +97,26 @@ async function chatWithChatGpt() {

chatWithChatGpt()
```
## Complete

Make a request to the AI


[https://m3o.com/ai/api#Complete](https://m3o.com/ai/api#Complete)

```js
const { AiService } = require('m3o/ai');

const aiService = new AiService(process.env.M3O_API_TOKEN)

// Make a request to the AI
async function completeTheText() {
const rsp = await aiService.complete({
"text": "who is leonardo davinci"
})
console.log(rsp)

}

completeTheText()
```
132 changes: 66 additions & 66 deletions examples/app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,99 +4,102 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/App/api](https

Endpoints:

## Run
## Logs

Run an app from source
Get the logs for an app


[https://m3o.com/app/api#Run](https://m3o.com/app/api#Run)
[https://m3o.com/app/api#Logs](https://m3o.com/app/api#Logs)

```js
const { AppService } = require('m3o/app');

const appService = new AppService(process.env.M3O_API_TOKEN)

// Run an app from source
async function runAnApp() {
const rsp = await appService.run({
"branch": "master",
"name": "helloworld",
"port": 8080,
"region": "europe-west1",
"repo": "github.com/asim/helloworld"
// Get the logs for an app
async function retrieveBuildLogsForAnApp() {
const rsp = await appService.logs({
"logs_type": "build",
"name": "helloworld"
})
console.log(rsp)

}

runAnApp()
retrieveBuildLogsForAnApp()
```
## Regions
## Get

Return the support regions
Get an app by name


[https://m3o.com/app/api#Regions](https://m3o.com/app/api#Regions)
[https://m3o.com/app/api#Get](https://m3o.com/app/api#Get)

```js
const { AppService } = require('m3o/app');

const appService = new AppService(process.env.M3O_API_TOKEN)

// Return the support regions
async function listRegions() {
const rsp = await appService.regions({})
// Get an app by name
async function getAnApp() {
const rsp = await appService.get({
"name": "helloworld"
})
console.log(rsp)

}

listRegions()
getAnApp()
```
## Resolve
## Run

Resolve an app by id to its raw backend endpoint
Run an app from source


[https://m3o.com/app/api#Resolve](https://m3o.com/app/api#Resolve)
[https://m3o.com/app/api#Run](https://m3o.com/app/api#Run)

```js
const { AppService } = require('m3o/app');

const appService = new AppService(process.env.M3O_API_TOKEN)

// Resolve an app by id to its raw backend endpoint
async function resolveAppById() {
const rsp = await appService.resolve({
"id": "helloworld"
// Run an app from source
async function runAnApp() {
const rsp = await appService.run({
"branch": "master",
"name": "helloworld",
"port": 8080,
"region": "europe-west1",
"repo": "github.com/asim/helloworld"
})
console.log(rsp)

}

resolveAppById()
runAnApp()
```
## Update
## Status

Update the app. The latest source code will be downloaded, built and deployed.
Get the status of an app


[https://m3o.com/app/api#Update](https://m3o.com/app/api#Update)
[https://m3o.com/app/api#Status](https://m3o.com/app/api#Status)

```js
const { AppService } = require('m3o/app');

const appService = new AppService(process.env.M3O_API_TOKEN)

// Update the app. The latest source code will be downloaded, built and deployed.
async function updateAnApp() {
const rsp = await appService.update({
// Get the status of an app
async function getTheStatusOfAnApp() {
const rsp = await appService.status({
"name": "helloworld"
})
console.log(rsp)

}

updateAnApp()
getTheStatusOfAnApp()
```
## Delete

Expand All @@ -121,51 +124,51 @@ async function deleteAnApp() {

deleteAnApp()
```
## Reserve
## Update

Reserve app names
Update the app. The latest source code will be downloaded, built and deployed.


[https://m3o.com/app/api#Reserve](https://m3o.com/app/api#Reserve)
[https://m3o.com/app/api#Update](https://m3o.com/app/api#Update)

```js
const { AppService } = require('m3o/app');

const appService = new AppService(process.env.M3O_API_TOKEN)

// Reserve app names
async function reserveAppName() {
const rsp = await appService.reserve({
// Update the app. The latest source code will be downloaded, built and deployed.
async function updateAnApp() {
const rsp = await appService.update({
"name": "helloworld"
})
console.log(rsp)

}

reserveAppName()
updateAnApp()
```
## Get
## Reserve

Get an app by name
Reserve app names


[https://m3o.com/app/api#Get](https://m3o.com/app/api#Get)
[https://m3o.com/app/api#Reserve](https://m3o.com/app/api#Reserve)

```js
const { AppService } = require('m3o/app');

const appService = new AppService(process.env.M3O_API_TOKEN)

// Get an app by name
async function getAnApp() {
const rsp = await appService.get({
// Reserve app names
async function reserveAppName() {
const rsp = await appService.reserve({
"name": "helloworld"
})
console.log(rsp)

}

getAnApp()
reserveAppName()
```
## List

Expand All @@ -188,50 +191,47 @@ async function listTheApps() {

listTheApps()
```
## Status
## Regions

Get the status of an app
Return the support regions


[https://m3o.com/app/api#Status](https://m3o.com/app/api#Status)
[https://m3o.com/app/api#Regions](https://m3o.com/app/api#Regions)

```js
const { AppService } = require('m3o/app');

const appService = new AppService(process.env.M3O_API_TOKEN)

// Get the status of an app
async function getTheStatusOfAnApp() {
const rsp = await appService.status({
"name": "helloworld"
})
// Return the support regions
async function listRegions() {
const rsp = await appService.regions({})
console.log(rsp)

}

getTheStatusOfAnApp()
listRegions()
```
## Logs
## Resolve

Get the logs for an app
Resolve an app by id to its raw backend endpoint


[https://m3o.com/app/api#Logs](https://m3o.com/app/api#Logs)
[https://m3o.com/app/api#Resolve](https://m3o.com/app/api#Resolve)

```js
const { AppService } = require('m3o/app');

const appService = new AppService(process.env.M3O_API_TOKEN)

// Get the logs for an app
async function retrieveBuildLogsForAnApp() {
const rsp = await appService.logs({
"logs_type": "build",
"name": "helloworld"
// Resolve an app by id to its raw backend endpoint
async function resolveAppById() {
const rsp = await appService.resolve({
"id": "helloworld"
})
console.log(rsp)

}

retrieveBuildLogsForAnApp()
resolveAppById()
```
46 changes: 23 additions & 23 deletions examples/bitcoin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,29 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/Bitcoin/api](h

Endpoints:

## Transaction

Get transaction details by hash


[https://m3o.com/bitcoin/api#Transaction](https://m3o.com/bitcoin/api#Transaction)

```js
const { BitcoinService } = require('m3o/bitcoin');

const bitcoinService = new BitcoinService(process.env.M3O_API_TOKEN)

// Get transaction details by hash
async function getAbitcoinTransaction() {
const rsp = await bitcoinService.transaction({
"hash": "f854aebae95150b379cc1187d848d58225f3c4157fe992bcd166f58bd5063449"
})
console.log(rsp)

}

getAbitcoinTransaction()
```
## Price

Get the price of bitcoin
Expand Down Expand Up @@ -73,26 +96,3 @@ async function lookupTransactionsByAddress() {

lookupTransactionsByAddress()
```
## Transaction

Get transaction details by hash


[https://m3o.com/bitcoin/api#Transaction](https://m3o.com/bitcoin/api#Transaction)

```js
const { BitcoinService } = require('m3o/bitcoin');

const bitcoinService = new BitcoinService(process.env.M3O_API_TOKEN)

// Get transaction details by hash
async function getAbitcoinTransaction() {
const rsp = await bitcoinService.transaction({
"hash": "f854aebae95150b379cc1187d848d58225f3c4157fe992bcd166f58bd5063449"
})
console.log(rsp)

}

getAbitcoinTransaction()
```
Loading

0 comments on commit 97c3604

Please sign in to comment.