routes.js 757 B

123456789101112131415161718192021222324
  1. 'use strict'
  2. /*
  3. |--------------------------------------------------------------------------
  4. | Routes
  5. |--------------------------------------------------------------------------
  6. |
  7. | Http routes are entry points to your web application. You can create
  8. | routes for different URL's and bind Controller actions to them.
  9. |
  10. | A complete guide on routing is available here.
  11. | http://adonisjs.com/docs/4.1/routing
  12. |
  13. */
  14. /** @type {typeof import('@adonisjs/framework/src/Route/Manager')} */
  15. const Route = use('Route')
  16. Route.get('/', 'VideoController.index').as('Main')
  17. Route.get('/watch/:id', 'VideoController.watch').as('Watch')
  18. Route.get('/lang/:lang', 'LangController.switch')
  19. Route.on('/add').render('add').as('Add')
  20. Route.post('/add', 'AddVidController.add')