import express from 'express';
import eventsGetAll from '../middleware/api/eventsGetAll';

const router = express.Router();

router.get('/', (request, response) => {
    response.json({success: true});
});

// TODO
// - Add GET for all data /data - return data + 200
router.get('/events', eventsGetAll);
//router.get('/data/:id', dataGetById);

// - Add POST to add new data /data - return 201
// - Add GET for single data element /data/:id -200 / 404
// - Add PUT to update single data element /data/:id - 200/204 (no content)/4040
// - Add DELETE to delete single data element /data/:id - 200/404
// - Add authentication - basic auth - 'auth' -> 'key:' (no password) + base64 encoded - 401 if failed

export default router;

@@ -231,28 +231,30 @@
 r all data /
-data
+events
  - return da
@@ -314,20 +314,22 @@
 r.get('/
-data
+events
 /:id', d
@@ -373,20 +373,22 @@
 w data /
-data
+events
  - retur
@@ -427,28 +427,30 @@
 ta element /
-data
+events
 /:id -200 / 
@@ -489,36 +489,38 @@
 e data element /
-data
+events
 /:id - 200/204 (
@@ -583,20 +583,22 @@
 lement /
-data
+events
 /:id - 2

Refactor API names for future use