{"size": 1803, "ext": "js", "max_stars_repo_path": "start/routes.js", "max_stars_repo_name": "raphaelsantosj/microblog-api", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "start/routes.js", "max_issues_repo_name": "raphaelsantosj/microblog-api", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "start/routes.js", "max_forks_repo_name": "raphaelsantosj/microblog-api", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 30.05, "max_line_length": 93, "alphanum_fraction": 0.6306156406}
'use strict'

/*
|--------------------------------------------------------------------------
| Routes
|--------------------------------------------------------------------------
|
| Http routes are entry points to your web application. You can create
| routes for different URL's and bind Controller actions to them.
|
| A complete guide on routing is available here.
| http://adonisjs.com/docs/4.0/routing
|
*/

const Route = use('Route')

Route.get('/', ({ request }) => {
  return { greeting: 'Hello world in JSON' }
})

Route.group(() => {
  Route.post('/signup', 'UserController.signup')
  Route.post('/login', 'UserController.login')
})

Route.group(() => {
  Route.get('/me', 'UserController.me')
  Route.put('/update_profile', 'UserController.updateProfile')
  Route.put('/change_password', 'UserController.changePassword');
})
.prefix('account')
.middleware(['auth:jwt'])

Route.group(() => {
  Route.get('/users_to_follow', 'UserController.usersToFollow');
  Route.post('/follow/:id', 'UserController.follow')
  Route.delete('/unfollow/:id', 'UserController.unFollow')
  Route.get('/timeline', 'UserController.timeline')
})
.prefix('users')
.middleware(['auth:jwt'])

Route.group(() => {
  Route.get(':username', 'UserController.showProfile')
})
.middleware(['auth:jwt'])

Route.post('/thinking', 'ThinkingController.thinking').middleware(['auth:jwt'])
Route.get('/thinking/:id', 'ThinkingController.show')
Route.post('/thinkings/reply/:id', 'ThinkingController.reply').middleware(['auth:jwt']);
Route.delete('/thinkings/destroy/:id', 'ThinkingController.destroy').middleware(['auth:jwt'])

Route.group(() => {
    Route.post('/create', 'FavoriteController.favorite')
    Route.delete('/destroy/:id', 'FavoriteController.unFavorite');
})
    .prefix('favorites')
    .middleware(['auth:jwt'])
