{"size": 1417, "ext": "js", "max_stars_repo_path": "routes.js", "max_stars_repo_name": "Akemiii/CloneFood_backend", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "routes.js", "max_issues_repo_name": "Akemiii/CloneFood_backend", "max_issues_repo_issues_event_min_datetime": "2021-05-08T17:13:48.000Z", "max_issues_repo_issues_event_max_datetime": "2021-05-08T17:13:48.000Z", "max_forks_repo_path": "routes.js", "max_forks_repo_name": "Akemiii/CloneFood_backend", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 1, "max_forks_count": null, "avg_line_length": 30.1489361702, "max_line_length": 90, "alphanum_fraction": 0.7529992943}
const express = require('express');
const router = express.Router();

//Rota inicial da api
router.get('/', (req,res) =>{
    res.status(200).send({
        title: 'Clone Food API',
        version: '0.0.1'
    });
});


//all these routes are use for client app
//Category
const CategoryController = require('./src/Controllers/CategoryController');
const RestaurantController = require('./src/Controllers/RestaurantController');
const OrderController = require('./src/Controllers/OrderController');
const ProductCategoryController  = require('./src/Controllers/ProductCategoryController');

//Categorias
router.get('/categories', CategoryController.index);
router.get('/categories/:id', CategoryController.show);
router.post('/categories', CategoryController.create);

//Restaurantes
router.get('/restaurants', RestaurantController.index);
router.post('/restaurants', RestaurantController.create);
router.get('/restaurants/:id', RestaurantController.show);
router.get('/restaurants/search/:name', RestaurantController.search);
router.patch('/restaurants/:id', RestaurantController.openClose);

//Orders
router.post('/order', OrderController.create);
router.get('/order/:id', OrderController.show);

//Product category
router.post('/product_category', ProductCategoryController.create);



//Products

//TODO delete all these routes, just for test. these routes are use for restaurants app


module.exports = router;
