Working on new version of website

Signed-off-by: Arthur DANJOU <arthurdanjou@outlook.fr>
This commit is contained in:
2021-08-05 15:26:36 +02:00
parent ed17d86913
commit 721eb3addc
43 changed files with 525 additions and 320 deletions

View File

@@ -3,15 +3,21 @@ import Application from "@ioc:Adonis/Core/Application";
Route.group(() => {
Route.get('/discord', 'ProfileController.discord')
Route.post('/states/:state', 'StatesController.set')
Route.resource('/users', 'UsersController')
Route.post('/locations', 'LocationsController.store')
Route.post('/projects', 'ProjectsController.store')
Route.resource('/files', 'FileController').only(['store', 'destroy'])
Route.get('/me', 'ProfileController.me')
Route.resource('/users', 'UsersController').except(['edit', 'create'])
Route.resource('/translations', 'TranslationsController').except(['edit', 'create'])
Route.resource('/locations', 'LocationsController').only(['index', 'store'])
Route.resource('/files', 'FileController').only(['index', 'store', 'destroy'])
Route.group(() => {
Route.get('/', 'FileController.index')
Route.get('/:filename', async ({response, params}) => {
response.download(Application.makePath('storage', params.filename))
})
}).prefix('/files')
}).middleware('auth')

View File

@@ -1,16 +1,23 @@
import Route from "@ioc:Adonis/Core/Route";
Route.group(() => {
Route.post('/form', 'FormsController.send')
Route.resource('/form', 'FormsController').except(['edit', 'create', 'update'])
Route.resource('/announces', 'AnnouncesController').except(['edit', 'create'])
Route.resource('/projects', 'ProjectsController').except(['edit', 'create'])
Route.resource('/profile', 'ProfilesController').only(['index', 'update'])
Route.group(() => {
Route.get('/:slug', 'PostsController.getLikes')
Route.post('/:slug/like', 'PostsController.like')
Route.post('/:slug/unlike', 'PostsController.unlike')
}).prefix('/posts')
Route.get('/subscribers', 'SubscribersController.get')
Route.post('/subscribers', 'SubscribersController.store')
Route.delete('/subscribers', 'SubscribersController.delete')
Route.get('/guestbook', 'GuestBookController.index')
Route.post('/guestbook', 'GuestBookController.store')
Route.post('/guestbook/:email', 'GuestBookController.store')
Route.resource('/subscribers', 'SubscribersController').only(['index', 'store', 'destroy'])
Route.resource('/guestbook', 'GuestBookController').except(['edit', 'create', 'destroy'])
Route.get('/guestbook/:email', 'GuestBookController.exists')
}).middleware('auth')

View File

@@ -12,9 +12,8 @@ Route.get('/', async ({response}: HttpContextContract) => {
source: `${BASE_URL}/source`,
healthCheck: `${BASE_URL}/health`,
routes: {
profile: `${BASE_URL}/profile`,
profile: `${BASE_URL}/me`,
//stats: `${BASE_URL}/stats`,
states: `${BASE_URL}/states`,
locations: `${BASE_URL}/locations`,
projects: `${BASE_URL}/projects`
}
@@ -36,8 +35,4 @@ Route.get('/health', async ({response}: HttpContextContract) => {
})
})
Route.get('/profile', 'ProfileController.me')
Route.get('/locations', 'LocationsController.get')
Route.get('/stats', 'StatsController.get')
Route.get('/states', 'StatesController.get')
Route.get('/projects', 'ProjectsController.get')