16 lines
389 B
TypeScript
16 lines
389 B
TypeScript
import express from 'express';
|
|
import globals from '../globals';
|
|
|
|
const router = express.Router();
|
|
|
|
router.get('/', (req, res) => {
|
|
res.json({status: 'API server up and running!'});
|
|
});
|
|
|
|
router.get('/authorized', (req, res) => {
|
|
if (!req.auth(res, globals.levels)) return;
|
|
res.json({status: 'Authorization successful', method: req.authDetails.method});
|
|
});
|
|
|
|
module.exports = router;
|