text: import { Router } from 'express';
  import multer from 'multer';
  
  import multerConfig from './config/multer';
  
  import SessionController from './app/controllers/SessionController';
  import UserController from './app/controllers/UserController';
  import FileController from './app/controllers/FileController';
  import ProviderController from './app/controllers/ProviderController';
  import AppointmentController from './app/controllers/AppointmentController';
  import ScheduleController from './app/controllers/ScheduleController';
  import NotificationController from './app/controllers/NotificationController';
  import AvailableController from './app/controllers/AvailableController';
  
  import authMiddleware from './app/middlewares/auth';
  
  const routes = new Router();
  const upload = multer(multerConfig);
  
  routes.post('/sessions', SessionController.store);
  routes.post('/users', UserController.store);
  /* a proteção de rotas valerá após o middleware global */
  routes.use(authMiddleware);
  routes.put('/users', UserController.update);
  
  routes.get('/providers', ProviderController.index);
  routes.get('/providers/:providerId/availables', AvailableController.index);
  
  routes.post('/files', upload.single('file'), FileController.store);
  
  routes.get('/appointments', AppointmentController.index);
  routes.post('/appointments', AppointmentController.store);
  routes.delete('/appointments/:id', AppointmentController.delete);
  
  routes.get('/schedules', ScheduleController.index);
  
  routes.get('/notifications', NotificationController.index);
  routes.put('/notifications/:id', NotificationController.update);
  
  export default routes;
  