I hereby claim:
- I am weienwong on github.
- I am wwong93 (https://keybase.io/wwong93) on keybase.
- I have a public key ASA1MBOUZm_UjaSPxZQqFk0pctBFzXX3w18iRPg5uo0zhgo
To claim this, I am signing this object:
package main | |
import ( | |
"fmt" | |
"io/ioutil" | |
"net/http" | |
"strconv" | |
"strings" | |
"time" | |
) |
server.on("request", (req, res) => { | |
const src = fs.createReadStream("./index.html"); | |
src.pipe(res) | |
}) | |
console.log(`Running on port ${port}`); | |
server.listen(port); |
;(async () => { | |
const browser = await puppeteer.launch() | |
const page = await browser.newPage() | |
await page.setBypassCSP(true) | |
await page.goto("http://localhost:8000") | |
const results = await new AxePuppeteer(page) | |
.analyze() | |
if (results.violations.length > 0) { | |
log(chalk.red.bold("Axe violations:")) |
I hereby claim:
To claim this, I am signing this object:
const SDK = require('@zesty-io/sdk') | |
const https = require('https') | |
require('dotenv').config() | |
const DEV_TOKEN = process.env.DEV_TOKEN | |
const INSTANCE_ZUID = process.env.INSTANCE_ZUID | |
const MODEL_ZUID = process.env.MODEL_ZUID | |
const sdk = new SDK(INSTANCE_ZUID, DEV_TOKEN) |
setInterval(() => { | |
const payload = { | |
data: { | |
moisture: `${Math.random() * 100}` | |
} | |
} | |
sdk.instance.createItem(MODEL_ZUID, payload).then(res => { | |
if (res.statusCode === 201) { | |
const itemZUID = res.data.ZUID |
async function publishItem (instanceZUID, modelZUID, itemZUID, version) { | |
const options = { | |
method: 'POST', | |
hostname: `${instanceZUID}.api.zesty.io`, | |
path: `/v1/content/models/${modelZUID}/items/${itemZUID}/publishings`, | |
headers: { | |
'Content-Type': 'application/json', | |
Authorization: `Bearer ${DEV_TOKEN}` | |
} | |
} |
const SDK = require('@zesty-io/sdk') | |
const https = require('https') | |
require('dotenv').config() | |
const DEV_TOKEN = process.env.DEV_TOKEN | |
const INSTANCE_ZUID = process.env.INSTANCE_ZUID | |
const MODEL_ZUID = process.env.MODEL_ZUID | |
const sdk = new SDK(INSTANCE_ZUID, DEV_TOKEN) |
require('dotenv').config() | |
const request = require('request') | |
// webhooks instances-api | |
function scheduleItemPublishWebhook () { | |
// create webhook | |
const createItemPublishWebhookOption = { | |
method: 'POST', | |
url: `${process.env.ACCOUNTS_API_HOST}/v1/webhooks`, | |
headers: { |
const routes = [ | |
{ | |
method: 'GET', | |
path: '/locations', | |
handler: async (request, h) => { | |
const db = server.app.db; | |
const locationCollection = db.collection('locations'); | |
// query all locations |