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 Jul 4, 2023
1 parent cbdf284 commit 53d92d1
Show file tree
Hide file tree
Showing 30 changed files with 1,288 additions and 1,288 deletions.
148 changes: 74 additions & 74 deletions examples/app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,169 +4,168 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/App/api](https

Endpoints:

## Status
## Get

Get the status of an app
Get an app by name


[https://m3o.com/app/api#Status](https://m3o.com/app/api#Status)
[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)

// Get the status of an app
async function getTheStatusOfAnApp() {
const rsp = await appService.status({
// Get an app by name
async function getAnApp() {
const rsp = await appService.get({
"name": "helloworld"
})
console.log(rsp)

}

getTheStatusOfAnApp()
getAnApp()
```
## Update
## List

Update the app. The latest source code will be downloaded, built and deployed.
List all the apps


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

```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({
"name": "helloworld"
})
// List all the apps
async function listTheApps() {
const rsp = await appService.list({})
console.log(rsp)

}

updateAnApp()
listTheApps()
```
## Logs
## Run

Get the logs for an app
Run an app from source


[https://m3o.com/app/api#Logs](https://m3o.com/app/api#Logs)
[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)

// Get the logs for an app
async function retrieveBuildLogsForAnApp() {
const rsp = await appService.logs({
"logs_type": "build",
"name": "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)

}

retrieveBuildLogsForAnApp()
runAnApp()
```
## Reserve
## Status

Reserve app names
Get the status of an app


[https://m3o.com/app/api#Reserve](https://m3o.com/app/api#Reserve)
[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)

// Reserve app names
async function reserveAppName() {
const rsp = await appService.reserve({
// Get the status of an app
async function getTheStatusOfAnApp() {
const rsp = await appService.status({
"name": "helloworld"
})
console.log(rsp)

}

reserveAppName()
getTheStatusOfAnApp()
```
## Get
## Resolve

Get an app by name
Resolve an app by id to its raw backend endpoint


[https://m3o.com/app/api#Get](https://m3o.com/app/api#Get)
[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 an app by name
async function getAnApp() {
const rsp = await appService.get({
"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)

}

getAnApp()
resolveAppById()
```
## List
## Update

List all the apps
Update the app. The latest source code will be downloaded, built and deployed.


[https://m3o.com/app/api#List](https://m3o.com/app/api#List)
[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)

// List all the apps
async function listTheApps() {
const rsp = await appService.list({})
// 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)

}

listTheApps()
updateAnApp()
```
## Run
## Reserve

Run an app from source
Reserve app names


[https://m3o.com/app/api#Run](https://m3o.com/app/api#Run)
[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)

// 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"
// Reserve app names
async function reserveAppName() {
const rsp = await appService.reserve({
"name": "helloworld"
})
console.log(rsp)

}

runAnApp()
reserveAppName()
```
## Regions

Expand All @@ -189,49 +188,50 @@ async function listRegions() {

listRegions()
```
## Resolve
## Delete

Resolve an app by id to its raw backend endpoint
Delete an app


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

```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"
// Delete an app
async function deleteAnApp() {
const rsp = await appService.delete({
"name": "helloworld"
})
console.log(rsp)

}

resolveAppById()
deleteAnApp()
```
## Delete
## Logs

Delete an app
Get the logs for an app


[https://m3o.com/app/api#Delete](https://m3o.com/app/api#Delete)
[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)

// Delete an app
async function deleteAnApp() {
const rsp = await appService.delete({
// Get the logs for an app
async function retrieveBuildLogsForAnApp() {
const rsp = await appService.logs({
"logs_type": "build",
"name": "helloworld"
})
console.log(rsp)

}

deleteAnApp()
retrieveBuildLogsForAnApp()
```
46 changes: 23 additions & 23 deletions examples/bitcoin/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/Bitcoin/api](h

Endpoints:

## Price

Get the price of bitcoin


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

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

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

// Get the price of bitcoin
async function getBitcoinPrice() {
const rsp = await bitcoinService.price({
"symbol": "USD"
})
console.log(rsp)

}

getBitcoinPrice()
```
## Balance

Get the BTC balance of an address
Expand Down Expand Up @@ -96,3 +73,26 @@ async function getAbitcoinTransaction() {

getAbitcoinTransaction()
```
## Price

Get the price of bitcoin


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

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

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

// Get the price of bitcoin
async function getBitcoinPrice() {
const rsp = await bitcoinService.price({
"symbol": "USD"
})
console.log(rsp)

}

getBitcoinPrice()
```
Loading

0 comments on commit 53d92d1

Please sign in to comment.