diff options
| author | Geo Halkiadakis <gchalkiadakis@sklavenitis.co.gr> | 2024-04-10 19:17:47 +0300 |
|---|---|---|
| committer | Geo Halkiadakis <gchalkiadakis@sklavenitis.co.gr> | 2024-04-10 19:17:47 +0300 |
| commit | f6682b3a1d90ae4f0b86edebb28ebb17a811b57a (patch) | |
| tree | fada5ca63432aff43e04511e2878ca0704af4349 /paths.js | |
| parent | 54048a674e89fb90deb9766433c1dc01c8924c5b (diff) | |
| download | oseine-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.js | 30 |
1 files changed, 26 insertions, 4 deletions
@@ -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(); }); |
