From 1d481a17ae65e4785e2db4aaa7ee15bd5c5c3b10 Mon Sep 17 00:00:00 2001 From: Ben Elferink Date: Fri, 25 Dec 2020 19:18:56 +0200 Subject: [PATCH] added new post example route --- server/routes/route.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/routes/route.js b/server/routes/route.js index 98c7875..4068436 100644 --- a/server/routes/route.js +++ b/server/routes/route.js @@ -1,5 +1,5 @@ import express from 'express'; -import getExamples from './../controllers/controller.js'; // import request & response function +import { getExamples, uploadExample } from './../controllers/controller.js'; // import request & response function const router = express.Router(); // initialize router @@ -7,6 +7,7 @@ const router = express.Router(); // initialize router 1st param = extended path location 2nd param = request & response function */ -router.get('/examples', getExamples); // current path: http://localhost:8080/examples +router.get('/', getExamples); // current path: http://localhost:8080/example +router.post('/upload', uploadExample); // current path: http://localhost:8080/example/upload export default router;