summaryrefslogtreecommitdiff
path: root/paths.js
diff options
context:
space:
mode:
authorGeo Halkiadakis <gchalkiadakis@sklavenitis.co.gr>2024-04-10 19:17:47 +0300
committerGeo Halkiadakis <gchalkiadakis@sklavenitis.co.gr>2024-04-10 19:17:47 +0300
commitf6682b3a1d90ae4f0b86edebb28ebb17a811b57a (patch)
treefada5ca63432aff43e04511e2878ca0704af4349 /paths.js
parent54048a674e89fb90deb9766433c1dc01c8924c5b (diff)
downloadoseine-f6682b3a1d90ae4f0b86edebb28ebb17a811b57a.tar.gz
oseine-f6682b3a1d90ae4f0b86edebb28ebb17a811b57a.tar.bz2
oseine-f6682b3a1d90ae4f0b86edebb28ebb17a811b57a.zip
compare supplamentary search core implementations (for vs find, etc)
Diffstat (limited to 'paths.js')
-rw-r--r--paths.js30
1 files changed, 26 insertions, 4 deletions
diff --git a/paths.js b/paths.js
index 7d33877..6c2d1ac 100644
--- a/paths.js
+++ b/paths.js
@@ -1,11 +1,12 @@
const Router = require('koa-router');
const kb = require('./pieces/kb-util.js');
const data = require('./pieces/prepare-streams');
-const prod = require('./data/j.json');
+const products = require('./data/products.json');
+const bench = require('./benchmark/find.js');
// Prefix all routes with: /items
const router = new Router({
- //// prefix: '/items'
+ // prefix: '/items'
});
/* simple route example
@@ -61,12 +62,20 @@ router.get('/search/:title', (ctx, next) => {
next();
});
+
+
/** other routes
+ * /////////////////////////////////////////////////////////////////////////////
* + /suggest/<some search string>
* + /prepare (products, keywords, linked-terms etc)
* + /stats
*/
+
+
+// TEST routes
+////////////////////////////////////////////////////////////////////////////////
+
router.get('/test', (ctx, next) => { // easy test route
// test anything ...
let result = { success: true, data: [1, 2, 3] };
@@ -76,14 +85,27 @@ router.get('/test', (ctx, next) => { // easy test route
router.get('/test/do-data', (ctx, next) => { // easy test route
// test anything ...
- data.create();
+ // data.create(
+ // 'products',
+ // 'https://storage.googleapis.com/pythia-files/uploads/json/emarket-products.json'
+ // );
+ data.load_products(
+ 'https://storage.googleapis.com/pythia-files/uploads/json/emarket-products.json'
+ );
ctx.body = { success: true, operation: 'create new data' };
next();
});
router.get('/test/json', (ctx, next) => { // easy test route
// test anything ...
- ctx.body = { t: + new Date(), p: prod };
+ ctx.body = { t: + new Date(), p: products };
+ next();
+});
+
+router.get('/bench/fe', (ctx, next) => { // easy test route
+ // test anything ...
+ // ctx.body = bench.compare();
+ ctx.body = bench.byFor();
next();
});