Would you like to clone this notebook?

When you clone a notebook you are able to make changes without affecting the original notebook.


Endpoint Demo

node v6.17.1
version: master
The world's simplest hit counter, using a hosted database service called Orchestrate: https://orchestrate.io
var db = require('orchestrate')(process.env.ORCHESTRATE_KEY) exports.tonicEndpoint = async function(request, response) { await db.newPatchBuilder("counts", process.env.TONIC_MOUNT_PATH) .upsert(true) .init("count", 0) .inc("count") .apply() var hits = await db.get("counts", process.env.TONIC_MOUNT_PATH) response.end(hits.body.count.toString()) }
We've set our Orchestrate API key in our environment variables, which we use to initialize the db at the start. Then, on every request, we simply increment the count. Finally, we retrieve the current count and return it. It's important to do the increment this way, so that concurrent updates aren't lost. We then read back out the current value, which may have been updated by someone else already, but that doesn't much matter. The count is stored on a document with an ID matching the "TONIC_MOUNT_PATH" environment variable, which is the URL of this document.


  • posted 4 years ago by akhond
    need my payments to 2,=- 02?$ #7
  • posted 3 years ago by rahasia
  • posted 3 years ago by anspage
  • posted 2 years ago by 5d2bdf3e60baea001a0a3a67
    Remove frp
  • posted 2 years ago by bigbenqb7
    Remove all
  • posted 2 years ago by lokolops
  • posted a year ago by w5g
  • posted a year ago by success156
    cash deposit request #30,000,000-transfer this to George Ekopimoh Monday that its my ballance check~live account
  • posted a year ago by success156
    300,000$ balance from undue cheque name: George Ekopimoh Monday
  • posted a year ago by falcoblck
    npm i lodash
  • posted a year ago by kohlim6
    Fit in github acCount
  • posted a year ago by mandy34
  • posted a year ago by shannawhaley0
  • posted a year ago by abc482
  • posted 10 months ago by yanuar444
    0747459374 yanuar harsanto bank negara indonesia
  • posted 8 months ago by nicolefu
    6303361675 iluvcock
  • posted 7 months ago by ahmadshir
  • posted 6 months ago by quangthong81
  • posted 3 months ago by chucky-ux
    Mario K
  • posted 2 months ago by 6113582c01f30b001a51ccf8
    hi was everyone

sign in to comment