UNPKG

notion-page-tree

Version:

Recursively fetch nested Notion pages from the root page/database/block node.

17 lines (16 loc) 735 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.searchServerHandler = void 0; var searchServerHandler = function (app, data_set) { app.get('/search', function (req, res) { data_set.search_index ? req.query.keyword && req.query.keyword !== '' ? res.send(JSON.stringify(data_set.search_index.search("".concat(req.query.keyword .split(' ') .map(function (word) { return "*".concat(word, "* ").concat(word, "~").concat(Math.floor(word.length / 4)); }) .join(' '))))) : res.sendStatus(502) : res.sendStatus(503); }); }; exports.searchServerHandler = searchServerHandler;