Skip to content

Instantly share code, notes, and snippets.

@evanxg852000
Created June 28, 2020 11:24
Show Gist options
  • Save evanxg852000/856204668a8823007ccc2be89bd83fe9 to your computer and use it in GitHub Desktop.
Save evanxg852000/856204668a8823007ccc2be89bd83fe9 to your computer and use it in GitHub Desktop.
//functions.js
function API(req, res) { //http function
const ip = res.socket.remoteAddress;
console.log(`Client ip address is ${ip}.`);
res.writeHead(200);
res.end('Hello, World!');
}
function Ticker(envs) { //cron function
console.log(envs);
console.log(`Ticker ticked at ${Date.now()}`);
}
module.exports = {
API,
Ticker
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment