From be2f575bca14f910c130012ebf0c3930a97f8a61 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Wed, 7 Nov 2018 22:05:43 +0100 Subject: Added elasticsearch based database --- routes/index.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'routes') diff --git a/routes/index.js b/routes/index.js index 26ecf65..570aea0 100644 --- a/routes/index.js +++ b/routes/index.js @@ -1,9 +1,18 @@ -const express = require('express'); +const database = require("../database"); +const express = require("express"); const router = express.Router(); /* GET home page. */ -router.get('/', function (req, res, next) { - res.json({message: "hey!"}) +router.get('/', (req, res, next) => { + database.search("crawled", { + size: 20, + from: 0, + query: { + match_all: {} + } + }).then(results => { + res.json(results.hits) + }) }); module.exports = router; \ No newline at end of file -- cgit v1.2.3