diff options
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 |
