summaryrefslogtreecommitdiff
path: root/routes/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'routes/index.js')
-rw-r--r--routes/index.js15
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