tethys.backend/start/routes/api.ts
Arno Kaimbacher 005df2e454
Some checks failed
CI Pipeline / japa-tests (push) Failing after 58s
- added backup codes for 2 factor authentication
- npm updates
- coverage validation: elevation ust be positive, depth must be negative
- vinejs-provider.js: get enabled extensions from database, not via validOptions.extnames
- vue components for backup codes: e.g.: PersonalSettings.vue
- validate spaital coverage in leaflet map: draw.component.vue, map.component.vue
- add backup code authentication into Login.vue
- preset to use no preferred reviewer: Release.vue
- 2 new vinejs validation rules: file_scan.ts and file-length.ts
2024-07-08 13:52:20 +02:00

36 lines
1.8 KiB
TypeScript

import router from '@adonisjs/core/services/router';
import AuthorsController from '#controllers/Http/Api/AuthorsController';
import DatasetController from '#controllers/Http/Api/DatasetController';
import HomeController from '#controllers/Http/Api/HomeController';
import FileController from '#controllers/Http/Api/FileController';
import AvatarController from '#controllers/Http/Api/AvatarController';
import UserController from '#controllers/Http/Api/UserController';
import { middleware } from '../kernel.js'
// API
router.group(() => {
router.get('authors', [AuthorsController, "index"]).as('author.index');
router.get('datasets', [DatasetController, "index"]).as('dataset.index');
router.get('persons', [AuthorsController, "persons"]).as('author.persons');
router.get('/dataset', [DatasetController, "findAll"]).as('dataset.findAll');
router.get('/dataset/:publish_id', [DatasetController, "findOne"]).as('dataset.findOne');
router.get('/sitelinks/:year', [HomeController, "findDocumentsPerYear"]);
router.get('/years', [HomeController, "findYears"]);
router.get('/statistic/:year', [HomeController, "findPublicationsPerMonth"]);
router.get('/download/:id', [FileController, "findOne"]).as('file.findOne');
router.get('/avatar/:name/:background?/:textColor?/:size?', [AvatarController, 'generateAvatar']);
router.post('/twofactor_totp/settings/enable/:state/:code?', [UserController, 'enable']).as('apps.twofactor_totp.enable') .use(middleware.auth());
router.post('/twofactor_backupcodes/settings/create', [UserController, 'createCodes']).as('apps.twofactor_backupcodes.create') .use(middleware.auth());
})
// .namespace('App/Controllers/Http/Api')
.prefix('api');