Skip to content

Instantly share code, notes, and snippets.

@thomascallahan
thomascallahan / handler.js
Created February 14, 2021 01:30 — forked from mcky/handler.js
Sanity.io + Serverless + Algolia
const algoliasearch = require('algoliasearch');
const request = require('request');
const ndjson = require('ndjson');
const {bindNodeCallback} = require('rxjs');
const {streamToRx} = require('rxjs-stream');
const {bufferCount, map, mergeMap, toArray, tap} = require('rxjs/operators');
// Algolia configuration
const algoliaApp = process.env.ALGOLIA_APP_ID;