diff options
| author | Geo Halkiadakis <gchalkiadakis@sklavenitis.co.gr> | 2024-04-10 13:29:01 +0300 |
|---|---|---|
| committer | Geo Halkiadakis <gchalkiadakis@sklavenitis.co.gr> | 2024-04-10 13:29:01 +0300 |
| commit | 2676484041e8771257bf99ed223bd9321fe72fa8 (patch) | |
| tree | ef2e71a6623eabe67bfb4c9732f5271ca945b509 /paths.js | |
| parent | 0c65dee04506567ee50537ff2fbb83998b8fef0f (diff) | |
| download | oseine-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.js | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -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 |
