node.js testaustime heartbeat

📅 2022-03-05T13:08:48.567Z
👁️ 332 katselukertaa
🔓 Julkinen


const fetch = require('node-fetch');

let url = 'https://time.lajp.fi/activity/update';

let options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', Authorization: 'Bearer <INSERT-YOUR-TOKEN-HERE>'},
  body: '{"project_name":"imap.fi","language":"js","editor_name":"vscode","hostname":"pikkukarhu"}'
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error('error:' + err));