2023-03-03 15:54:28 +00:00
|
|
|
import Route from '@ioc:Adonis/Core/Route';
|
|
|
|
|
|
|
|
// API
|
|
|
|
Route.group(() => {
|
2023-06-22 15:20:04 +00:00
|
|
|
// Route.post("register", "AuthController.register");
|
|
|
|
// Route.post("login", "AuthController.login");
|
2023-03-03 15:54:28 +00:00
|
|
|
|
2023-06-22 15:20:04 +00:00
|
|
|
Route.group(() => {
|
|
|
|
Route.get('authors', 'AuthorsController.index').as('author.index');
|
|
|
|
Route.get('datasets', 'DatasetController.index').as('dataset.index');
|
|
|
|
Route.get('persons', 'AuthorsController.persons').as('author.persons');
|
|
|
|
// Route.get("author/:id", "TodosController.show");
|
|
|
|
// Route.put("author/update", "TodosController.update");
|
|
|
|
// Route.post("author", "TodosController.store");
|
2023-09-04 11:24:58 +00:00
|
|
|
Route.get('/dataset', 'DatasetController.findAll').as('dataset.findAll');
|
|
|
|
Route.get('/dataset/:publish_id', 'DatasetController.findOne').as('dataset.findOne');
|
|
|
|
Route.get('/sitelinks/:year', 'HomeController.findDocumentsPerYear');
|
|
|
|
Route.get('/years', 'HomeController.findYears');
|
2023-11-22 16:06:55 +00:00
|
|
|
|
|
|
|
Route.get('/download/:id', 'FileController.findOne').as('file.findOne');
|
2023-12-15 16:17:33 +00:00
|
|
|
|
2024-01-19 14:33:46 +00:00
|
|
|
Route.get('/avatar/:name/:background?/:textColor?/:size?', 'AvatarController.generateAvatar');
|
|
|
|
|
|
|
|
|
|
|
|
Route.post('/twofactor_totp/settings/enable/:state/:code?', 'UserController.enable').as('apps.twofactor_totp.enable') .middleware(['auth']);;
|
2023-06-22 15:20:04 +00:00
|
|
|
});
|
|
|
|
// .middleware("auth:api");
|
2023-03-03 15:54:28 +00:00
|
|
|
})
|
2023-06-22 15:20:04 +00:00
|
|
|
.namespace('App/Controllers/Http/Api')
|
|
|
|
.prefix('api');
|