forked from usingbrain/creativeWidgetsServer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrouter.js
More file actions
20 lines (13 loc) · 646 Bytes
/
Copy pathrouter.js
File metadata and controls
20 lines (13 loc) · 646 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
const { Router } = require('express');
const ApiClient = require('./Controllers/widget.controller');
const router = Router();
// gets all widget ids and names from the db to the front end to render later on select
router.get('/widgets', ApiClient.getAllWidgets);
//creates the widget in the db
router.post('/widget', ApiClient.createWidget);
//gets the widget information about a specific widget (when user clicks on the list)
router.get('/widget/:id', ApiClient.getWidget);
router.post('/widget/:id', ApiClient.updateWidget);
//removes the widget from the db
router.delete('/widget/:id', ApiClient.removeWidget);
module.exports = router;