summaryrefslogtreecommitdiff
path: root/paths.js
diff options
context:
space:
mode:
authorGeo Halkiadakis <gchalkiadakis@sklavenitis.co.gr>2024-04-10 13:29:01 +0300
committerGeo Halkiadakis <gchalkiadakis@sklavenitis.co.gr>2024-04-10 13:29:01 +0300
commit2676484041e8771257bf99ed223bd9321fe72fa8 (patch)
treeef2e71a6623eabe67bfb4c9732f5271ca945b509 /paths.js
parent0c65dee04506567ee50537ff2fbb83998b8fef0f (diff)
downloadoseine-2676484041e8771257bf99ed223bd9321fe72fa8.tar.gz
oseine-2676484041e8771257bf99ed223bd9321fe72fa8.tar.bz2
oseine-2676484041e8771257bf99ed223bd9321fe72fa8.zip
working on a custom fs-cache system
Diffstat (limited to 'paths.js')
-rw-r--r--paths.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/paths.js b/paths.js
index 2653ff3..7d33877 100644
--- a/paths.js
+++ b/paths.js
@@ -1,5 +1,7 @@
const Router = require('koa-router');
const kb = require('./pieces/kb-util.js');
+const data = require('./pieces/prepare-streams');
+const prod = require('./data/j.json');
// Prefix all routes with: /items
const router = new Router({
@@ -39,6 +41,10 @@ const router = new Router({
*/
+// NOTE: set timeout per route (how-to)
+// https://stackoverflow.com/questions/66634123/how-to-add-individual-timeout-value-per-specific-route-using-node-js
+
+
// Routes
router.get('/search', (ctx, next) => {
@@ -68,4 +74,17 @@ router.get('/test', (ctx, next) => { // easy test route
next();
});
+router.get('/test/do-data', (ctx, next) => { // easy test route
+ // test anything ...
+ data.create();
+ 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 };
+ next();
+});
+
module.exports = router; \ No newline at end of file