{"size": 1868, "ext": "js", "max_stars_repo_path": "src/routes.js", "max_stars_repo_name": "chmenegatti/gympoint", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/routes.js", "max_issues_repo_name": "chmenegatti/gympoint", "max_issues_repo_issues_event_min_datetime": "2019-10-20T12:51:39.000Z", "max_issues_repo_issues_event_max_datetime": "2021-09-02T00:54:08.000Z", "max_forks_repo_path": "src/routes.js", "max_forks_repo_name": "chmenegatti/gympoint", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 3, "max_forks_count": null, "avg_line_length": 38.9166666667, "max_line_length": 78, "alphanum_fraction": 0.7847965739}
import { Router } from 'express';
import userController from './app/controllers/UserController';
import studentsController from './app/controllers/StudentsController';
import sessionConstroller from './app/controllers/SessionController';
import plansController from './app/controllers/PlansController';
import subscriptionController from './app/controllers/SubscriptionController';
import checkinController from './app/controllers/CheckinController';
import helpOrdersController from './app/controllers/HelpOrdersController';
import answerHelpController from './app/controllers/AnswerHelpController';
import authMiddleware from './app/middleware/auth';

const routes = new Router();

routes.post('/user', userController.store);
routes.post('/session', sessionConstroller.store);
routes.get('/students/:id/checkins', checkinController.index);
routes.post('/students/:id/checkins', checkinController.store);
routes.get('/students/:id/help-orders', helpOrdersController.index);
routes.post('/students/:id/help-orders', helpOrdersController.store);

routes.use(authMiddleware);
routes.post('/students', studentsController.store);
routes.put('/students/:id', studentsController.update);

/**
 * Plans Manager
 */
routes.get('/plans', plansController.index);
routes.post('/plans', plansController.store);
routes.put('/plans/:id', plansController.update);
routes.delete('/plans/:id', plansController.delete);

/**
 * Subscription Manager
 */
routes.get('/subscription', subscriptionController.index);
routes.post('/subscription', subscriptionController.store);
routes.put('/subscription/:id', subscriptionController.update);
routes.delete('/subscription/:id', subscriptionController.delete);

/**
 * Helping Orders Manager
 */

routes.get('/help-orders', answerHelpController.index);
routes.put('/help-orders/:id/answer', answerHelpController.update);
export default routes;
