Node client for api.begin.com
Obtain an access_token
by creating a client at https://api.begin.com.
Install
npm i @begin/api
ESM
import { App } from '@begin/api'
CJS
const { App } = require('@begin/api')
Usage
App static methods
let { apps } = await App.list()
let app = await App.find({ access_token, appID })
let app = await App.create({ access_token, name, zip })
App instance methods
let logs = await app.logs()
let logs = await app.builds()
await app.deploy({ name, zip })
await app.destroy()
Work with environment variables
let { env } = await app.env.get()
await app.env.set({ key: "HENLO", value: "world" })
await app.env.destroy({ key: "HENLO" })
Work with static assets
let { files } = await app.static.get()
let body = Buffer.from('console.log("hi")').toString('base64')
await app.static.set({ name: '/file.js', body })
await app.static.destroy({ name: '/file.js' })