with Minerstat and Neon Postgres?
import { axios } from "@pipedream/platform"
export default defineComponent({
props: {
minerstat: {
type: "app",
app: "minerstat",
}
},
async run({steps, $}) {
return await axios($, {
url: `https://api.minerstat.com/v2/worker`,
headers: {
Authorization: `Bearer ${this.minerstat.$auth.api_token}`,
"Accept": `application/json`,
},
params: {
name: `Apollo`,
},
})
},
})
import { axios } from "@pipedream/platform";
import { neon } from "@neondatabase/serverless";
export default defineComponent({
props: {
neon_postgres: {
type: "app",
app: "neon_postgres",
}
},
async run({ steps, $ }) {
const { host, port, user, password, database } = this.neon_postgres.$auth
const connectionString = `postgresql://${user}:${password}@${host}:${port}/${database}`
const sql = neon(connectionString)
const result = await sql`SELECT version()`
const { version } = result[0]
return version
},
})