/
githubmirror
/
strapi
Обзор
Документация
Войти
/
githubmirror
/
strapi
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
packages/plugins/documentation/server/src/routes/index.ts
82 строки
2 KB
Alexandre Bodin
chore: migrate doc plugin to ts
21 мар 2024, 20:20
21 мар 2024, 20:20
eedd4c9
Код
Авторство
О чём код?
import restrictAccess from '../middlewares/restrict-access'; export default [ { method: 'GET', path: '/', handler: 'documentation.index', config: { auth: false, middlewares: [restrictAccess], }, }, { method: 'GET', path: '/v:major(\\d+).:minor(\\d+).:patch(\\d+)', handler: 'documentation.index', config: { auth: false, middlewares: [restrictAccess], }, }, { method: 'GET', path: '/login', handler: 'documentation.loginView', config: { auth: false, }, }, { method: 'POST', path: '/login', handler: 'documentation.login', config: { auth: false, }, }, { method: 'GET', path: '/getInfos', handler: 'documentation.getInfos', config: { policies: [ { name: 'admin::hasPermissions', config: { actions: ['plugin::documentation.read'] } }, ], }, }, { method: 'POST', path: '/regenerateDoc', handler: 'documentation.regenerateDoc', config: { policies: [ { name: 'admin::hasPermissions', config: { actions: ['plugin::documentation.settings.regenerate'] }, }, ], }, }, { method: 'PUT', path: '/updateSettings', handler: 'documentation.updateSettings', config: { policies: [ { name: 'admin::hasPermissions', config: { actions: ['plugin::documentation.settings.update'] }, }, ], }, }, { method: 'DELETE', path: '/deleteDoc/:version', handler: 'documentation.deleteDoc', config: { policies: [], }, }, ];