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 6, 2023
1 parent 8c5ea72 commit 588f83c
Show file tree
Hide file tree
Showing 30 changed files with 1,133 additions and 1,133 deletions.
132 changes: 66 additions & 66 deletions examples/app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,144 +4,167 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/App/api](https

Endpoints:

## Logs
## Get

Get the logs for an app
Get an app by name


[https://m3o.com/app/api#Logs](https://m3o.com/app/api#Logs)
[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 logs for an app
async function retrieveBuildLogsForAnApp() {
const rsp = await appService.logs({
"logs_type": "build",
// Get an app by name
async function getAnApp() {
const rsp = await appService.get({
"name": "helloworld"
})
console.log(rsp)

}

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

}

resolveAppById()
```
## Update

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


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

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

}

getAnApp()
updateAnApp()
```
## Status
## Delete

Get the status of an app
Delete an app


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

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

}

getTheStatusOfAnApp()
deleteAnApp()
```
## Update
## Logs

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


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

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

}

updateAnApp()
retrieveBuildLogsForAnApp()
```
## Delete
## Reserve

Delete an app
Reserve app names


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

// Delete an app
async function deleteAnApp() {
const rsp = await appService.delete({
// Reserve app names
async function reserveAppName() {
const rsp = await appService.reserve({
"name": "helloworld"
})
console.log(rsp)

}

deleteAnApp()
reserveAppName()
```
## List

Expand Down Expand Up @@ -212,26 +235,3 @@ async function listRegions() {

listRegions()
```
## Resolve

Resolve an app by id to its raw backend endpoint


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

// Resolve an app by id to its raw backend endpoint
async function resolveAppById() {
const rsp = await appService.resolve({
"id": "helloworld"
})
console.log(rsp)

}

resolveAppById()
```
94 changes: 47 additions & 47 deletions examples/cache/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,53 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/Cache/api](htt

Endpoints:

## Set

Set an item in the cache. Overwrites any existing value already set.


[https://m3o.com/cache/api#Set](https://m3o.com/cache/api#Set)

```js
const { CacheService } = require('m3o/cache');

const cacheService = new CacheService(process.env.M3O_API_TOKEN)

// Set an item in the cache. Overwrites any existing value already set.
async function setAvalue() {
const rsp = await cacheService.set({
"key": "foo",
"value": "bar"
})
console.log(rsp)

}

setAvalue()
```
## Get

Get an item from the cache by key. If key is not found, an empty response is returned.


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

```js
const { CacheService } = require('m3o/cache');

const cacheService = new CacheService(process.env.M3O_API_TOKEN)

// Get an item from the cache by key. If key is not found, an empty response is returned.
async function getAvalue() {
const rsp = await cacheService.get({
"key": "foo"
})
console.log(rsp)

}

getAvalue()
```
## Delete

Delete a value from the cache. If key not found a success response is returned.
Expand Down Expand Up @@ -96,50 +143,3 @@ async function listTheKeys() {

listTheKeys()
```
## Set

Set an item in the cache. Overwrites any existing value already set.


[https://m3o.com/cache/api#Set](https://m3o.com/cache/api#Set)

```js
const { CacheService } = require('m3o/cache');

const cacheService = new CacheService(process.env.M3O_API_TOKEN)

// Set an item in the cache. Overwrites any existing value already set.
async function setAvalue() {
const rsp = await cacheService.set({
"key": "foo",
"value": "bar"
})
console.log(rsp)

}

setAvalue()
```
## Get

Get an item from the cache by key. If key is not found, an empty response is returned.


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

```js
const { CacheService } = require('m3o/cache');

const cacheService = new CacheService(process.env.M3O_API_TOKEN)

// Get an item from the cache by key. If key is not found, an empty response is returned.
async function getAvalue() {
const rsp = await cacheService.get({
"key": "foo"
})
console.log(rsp)

}

getAvalue()
```
Loading

0 comments on commit 588f83c

Please sign in to comment.