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 Sep 4, 2023
1 parent f135dfe commit 472245a
Show file tree
Hide file tree
Showing 24 changed files with 1,044 additions and 1,044 deletions.
136 changes: 68 additions & 68 deletions examples/app/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/App/api](https

Endpoints:

## Status

Get the status of an app


[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)

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

}

getTheStatusOfAnApp()
```
## Get

Get an app by name
Expand All @@ -27,26 +50,26 @@ async function getAnApp() {

getAnApp()
```
## List
## Regions

List all the apps
Return the support regions


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

// List all the apps
async function listTheApps() {
const rsp = await appService.list({})
// Return the support regions
async function listRegions() {
const rsp = await appService.regions({})
console.log(rsp)

}

listTheApps()
listRegions()
```
## Run

Expand Down Expand Up @@ -75,72 +98,51 @@ async function runAnApp() {

runAnApp()
```
## Regions

Return the support regions


[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)

// Return the support regions
async function listRegions() {
const rsp = await appService.regions({})
console.log(rsp)

}

listRegions()
```
## Status
## Resolve

Get the status of an app
Resolve an app by id to its raw backend endpoint


[https://m3o.com/app/api#Status](https://m3o.com/app/api#Status)
[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 status of an app
async function getTheStatusOfAnApp() {
const rsp = await appService.status({
"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)

}

getTheStatusOfAnApp()
resolveAppById()
```
## Resolve
## Update

Resolve an app by id to its raw backend endpoint
Update the app. The latest source code will be downloaded, built and deployed.


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

// Resolve an app by id to its raw backend endpoint
async function resolveAppById() {
const rsp = await appService.resolve({
"id": "helloworld"
// 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)

}

resolveAppById()
updateAnApp()
```
## Delete

Expand All @@ -165,73 +167,71 @@ async function deleteAnApp() {

deleteAnApp()
```
## Reserve
## Logs

Reserve app names
Get the logs for an app


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

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

}

reserveAppName()
retrieveBuildLogsForAnApp()
```
## Update
## Reserve

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


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

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

}

updateAnApp()
reserveAppName()
```
## Logs
## List

Get the logs for an app
List all the apps


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

// Get the logs for an app
async function retrieveBuildLogsForAnApp() {
const rsp = await appService.logs({
"logs_type": "build",
"name": "helloworld"
})
// List all the apps
async function listTheApps() {
const rsp = await appService.list({})
console.log(rsp)

}

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

Endpoints:

## Price
## Lookup

Get the price of bitcoin
Get details for a bitcoin address


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

```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"
// Get details for a bitcoin address
async function lookupTransactionsByAddress() {
const rsp = await bitcoinService.lookup({
"address": "1MDUoxL1bGvMxhuoDYx6i11ePytECAk9QK"
})
console.log(rsp)

}

getBitcoinPrice()
lookupTransactionsByAddress()
```
## Balance
## Transaction

Get the BTC balance of an address
Get transaction details by hash


[https://m3o.com/bitcoin/api#Balance](https://m3o.com/bitcoin/api#Balance)
[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 the BTC balance of an address
async function getAbitcoinAddressBalance() {
const rsp = await bitcoinService.balance({
"address": "1MDUoxL1bGvMxhuoDYx6i11ePytECAk9QK"
// Get transaction details by hash
async function getAbitcoinTransaction() {
const rsp = await bitcoinService.transaction({
"hash": "f854aebae95150b379cc1187d848d58225f3c4157fe992bcd166f58bd5063449"
})
console.log(rsp)

}

getAbitcoinAddressBalance()
getAbitcoinTransaction()
```
## Lookup
## Price

Get details for a bitcoin address
Get the price of bitcoin


[https://m3o.com/bitcoin/api#Lookup](https://m3o.com/bitcoin/api#Lookup)
[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 details for a bitcoin address
async function lookupTransactionsByAddress() {
const rsp = await bitcoinService.lookup({
"address": "1MDUoxL1bGvMxhuoDYx6i11ePytECAk9QK"
// Get the price of bitcoin
async function getBitcoinPrice() {
const rsp = await bitcoinService.price({
"symbol": "USD"
})
console.log(rsp)

}

lookupTransactionsByAddress()
getBitcoinPrice()
```
## Transaction
## Balance

Get transaction details by hash
Get the BTC balance of an address


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

```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"
// Get the BTC balance of an address
async function getAbitcoinAddressBalance() {
const rsp = await bitcoinService.balance({
"address": "1MDUoxL1bGvMxhuoDYx6i11ePytECAk9QK"
})
console.log(rsp)

}

getAbitcoinTransaction()
getAbitcoinAddressBalance()
```

0 comments on commit 472245a

Please sign in to comment.