@overture-stack/lyric
Version:
Data Submission system
15 lines (14 loc) • 735 B
JavaScript
import { json, Router, urlencoded } from 'express';
import dictionaryController from '../controllers/dictionaryController.js';
import { authMiddleware } from '../middleware/auth.js';
const router = ({ baseDependencies, authConfig, }) => {
const router = Router();
router.use(urlencoded({ extended: false }));
router.use(json());
router.use(authMiddleware(authConfig));
router.post('/register', dictionaryController(baseDependencies).registerDictionary);
router.get('/category/:categoryId', dictionaryController(baseDependencies).getDictionaryJson);
router.get('/category/:categoryId/templates', dictionaryController(baseDependencies).downloadDataFileTemplates);
return router;
};
export default router;