mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-06 00:07:44 +01:00
21 lines
383 B
JavaScript
21 lines
383 B
JavaScript
|
'use strict';
|
||
|
|
||
|
const { Router } = require('express');
|
||
|
|
||
|
exports.router = function() {
|
||
|
const router = Router();
|
||
|
|
||
|
router.get('/', (req, res) => {
|
||
|
if (req.user) {
|
||
|
return res
|
||
|
.status(200)
|
||
|
.json(req.user)
|
||
|
.end();
|
||
|
} else {
|
||
|
return res.status(404).end();
|
||
|
}
|
||
|
});
|
||
|
|
||
|
return router;
|
||
|
};
|