summaryrefslogtreecommitdiff
path: root/payever/src/routes/app.js
diff options
context:
space:
mode:
Diffstat (limited to 'payever/src/routes/app.js')
-rw-r--r--payever/src/routes/app.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/payever/src/routes/app.js b/payever/src/routes/app.js
new file mode 100644
index 0000000..e759760
--- /dev/null
+++ b/payever/src/routes/app.js
@@ -0,0 +1,26 @@
+const express = require('express');
+const { catchErrors } = require('../utils/errorHandlers');
+const appController = require('../controllers/app');
+
+const router = express.Router();
+
+router.get(
+ '/api/user/:userId',
+ catchErrors(appController.getUser),
+ appController.returnUser
+);
+router.get(
+ '/api/user/:userId/avatar',
+ catchErrors(appController.getUser),
+ appController.getAvatarInfo,
+ catchErrors(appController.getAvatar)
+);
+
+router.delete(
+ '/api/user/:userId/avatar',
+ catchErrors(appController.getUser),
+ appController.getAvatarInfo,
+ catchErrors(appController.deleteAvatar)
+);
+
+module.exports = router;