Skip to content

Instantly share code, notes, and snippets.

@reichert621
Last active May 31, 2020 00:32
Show Gist options
  • Save reichert621/18e096679161528aaf0eb0d93315cc9e to your computer and use it in GitHub Desktop.
Save reichert621/18e096679161528aaf0eb0d93315cc9e to your computer and use it in GitHub Desktop.
Taro Example: Ping your server
const request = require('superagent');
const ping = async () => {
const res = await request.get('https://taro-beta.herokuapp.com/api/ping');
return res.body;
};
// Run function and verify output
ping().then(console.log).catch(console.log);
const main = () => ping();
// You must have a default export of the function you want to run
// in order for it to be deployed and scheduled
module.exports = main;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment