asyncanup's notebooks

  • slackbot-is-president-__ - /asyncanup/slackbot-is-the-president
    Last edited 4 months ago
    require('@runkit/runkit/express-endpoint/1.0.0')(exports) .post('/', require('body-parser')(), (req, res) => { res.json({ text: `_${req.body.text}_?\n*${Math.ceil(Math.random()*100)}% sure ${Math.random()>0.5?'YES':'NO'}!*`, response_type: 'in_channel' }) })
  • falcor-dummy-server - /asyncanup/falcor-dummy-server
    Last edited 2 years ago
    var falcor = require('falcor'); var FalcorServer = require('falcor-express'); var bodyParser = require('body-parser'); var express = require("@runkit/runkit/express-endpoint/1.0.0"); var app = express(exports); var model = new falcor.Model({ cache: { todos: [ { name: 'get milk from corner store', done: false }, { name: 'withdraw money from ATM', done: true } ] } }); app.use(bodyParser.text({ type: 'text/*' })) app.use('/model.json', FalcorServer.dataSourceRoute(function(req, res) { return model.asDataSource(); })); app.get('/', (req, res) => res.send('hi')); console.log('started');