diff options
author | Marvin Borner | 2018-11-07 22:05:43 +0100 |
---|---|---|
committer | Marvin Borner | 2018-11-07 22:05:43 +0100 |
commit | be2f575bca14f910c130012ebf0c3930a97f8a61 (patch) | |
tree | cd1a9ae15e6f9864c100e0fea32f3e0bd78a80fd /routes | |
parent | 824a2d9f587ca017fc71b84d835e72f54f9c87c4 (diff) |
Added elasticsearch based database
Diffstat (limited to 'routes')
-rw-r--r-- | routes/index.js | 15 |
1 files changed, 12 insertions, 3 deletions
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 |