You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
581 B

8 months ago
import Action from './../../packages/runner/actions/action.ts'
/**
* getting json from url, parse response and send to console
*
* @author Björn Hase <me@herr-hase.wtf>
* @license http://opensource.org/licenses/MIT The MIT License
* @link https://git.node001.net/HerrHase/super-hog.git
*
*/
class JsonExample extends Action {
async run() {
const response = await fetch(this.config.url)
if (response.status == 200) {
this.result = await response.json()
}
console.log(this.result)
}
}
export default JsonExample