LeagueStats/server/start/routes.js

36 lines
1.1 KiB
JavaScript
Raw Normal View History

'use strict'
/*
|--------------------------------------------------------------------------
| Routes
|--------------------------------------------------------------------------
|
| Http routes are entry points to your web application. You can create
| routes for different URLs and bind Controller actions to them.
|
| A complete guide on routing is available here.
| http://adonisjs.com/docs/4.1/routing
|
*/
/** @type {typeof import('@adonisjs/framework/src/Route/Manager')} */
const Route = use('Route')
const Match = use('App/Models/Match')
Route.get('/', async () => {
return {
2020-02-13 19:24:17 +00:00
greeting: 'Hello world from LeagueStats.gg',
match: await Match.first()
}
})
2020-02-13 19:30:26 +00:00
Route.post('/summoner/basic', 'SummonerController.basic')
Route.post('/summoner/overview', 'SummonerController.overview')
Route.post('/summoner/champions', 'SummonerController.champions')
Route.post('/summoner/records', 'SummonerController.records')
Route.post('/summoner/live', 'SummonerController.liveMatchDetails')
Route.post('/match', 'MatchController.index')
2020-02-13 19:30:26 +00:00
Route.post('/match/details', 'MatchController.show')
Route.post('/match/details/ranks', 'MatchController.showRanks')