{"size": 1727, "ext": "js", "max_stars_repo_path": "app/configs/sammy.config.js", "max_stars_repo_name": "EmiliyanPanagyurski/Book-Reviews", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "app/configs/sammy.config.js", "max_issues_repo_name": "EmiliyanPanagyurski/Book-Reviews", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "app/configs/sammy.config.js", "max_forks_repo_name": "EmiliyanPanagyurski/Book-Reviews", "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": 38.3777777778, "max_line_length": 90, "alphanum_fraction": 0.5975680371}
import { reviewController } from 'review-controller';
import { userControl } from 'user-controls';
import { userController } from 'user-controller';

class Router {
    start() {
        let sammy = Sammy(function () {
            this.get('#/home', (sammy) => {
                sammy.redirect('#/home/?page=1&pageSize=12');
            });

            this.get('#/home/?', reviewController.loadHomePage);
            this.get('#/home/search/?', reviewController.searchByTitle);

            // Category routes
            this.get('#/home/category/?', reviewController.loadCategory);
            this.get('#/home/review/:id', reviewController.loadReview);

            // User routes
            this.get('#/sign-up', userController.loadSignUpPage);
            this.post('#/sign-up', userController.signUp);
            this.get('#/sign-in', userController.loadSignInPage);
            this.post('#/sign-in', userController.signIn);
            this.get('#/sign-out', userController.signOut);
            this.get('#/home/profile/change-avatar', userController.loadProfilePicture);
            this.post('#/home/profile/change-avatar', userController.changeAvatar);
            this.get('#/home/profile/password-reset', userController.loadProfilePassword);

            // Reviews routes
            this.get('#/create-review', reviewController.loadCreateReviewPage);
            this.post('#/create-review', reviewController.createReview);
            this.post('#/home/review/:id/create-comment', reviewController.createComment);

            userControl.toggleUserControlElement();
        });

        $(function () {
            sammy.run('#/home');
        });
    }
}

const router = new Router();

export { router };