summaryrefslogtreecommitdiff
path: root/routes/v1.js
diff options
context:
space:
mode:
Diffstat (limited to 'routes/v1.js')
-rw-r--r--routes/v1.js18
1 files changed, 17 insertions, 1 deletions
diff --git a/routes/v1.js b/routes/v1.js
index 859f7b0..9690973 100644
--- a/routes/v1.js
+++ b/routes/v1.js
@@ -3,6 +3,7 @@
*/
const Router = require('koa-router');
+const prepare = require('../pieces/prepare.js');
// Prefix all routes with: /items
@@ -14,10 +15,25 @@ const router = new Router({
// Routes
+router.get('/prepare/:title', (ctx) => {
+ let result = false;
+ switch (ctx.params.title) {
+ case 'products':
+ result = prepare.load_products(
+ 'https://storage.googleapis.com/pythia-files/uploads/json/emarket-products.json'
+ );
+ break;
+
+ default:
+ break;
+
+ }
+ return { success: result };
+})
router.get('/search', (ctx) => {
- ctx.body = { success: true, results: [] };
+ ctx.body = [];
});
router.get('/search/:title', (ctx) => {