-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprofile.js
35 lines (33 loc) · 866 Bytes
/
profile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
const express = require('express');
const router = express.Router();
const auth = require('./authenticate');
/**
* @swagger
* /profile:
* get:
* summary: Get the user profile
* tags:
* - Auth
* responses:
* 200:
* description: User Profile
* components:
* securitySchemes:
* bearerAuth: # arbitrary name for the security scheme
* type: http
* scheme: bearer
* bearerFormat: JWT # optional, arbitrary value for documentation purposes
* security:
* - bearerAuth: []
*/
router.get('/', auth, (req, res) => {
return res.status(200).json({
status: 'success',
data: {
user: {
name: req.user.name,
},
},
});
});
module.exports = router;