{"size": 981, "ext": "js", "max_stars_repo_path": "api/src/routes.js", "max_stars_repo_name": "Gabriel382/series-schedule", "max_stars_repo_stars_event_min_datetime": "2021-02-01T23:55:07.000Z", "max_stars_repo_stars_event_max_datetime": "2021-02-01T23:55:07.000Z", "max_issues_repo_path": "api/src/routes.js", "max_issues_repo_name": "Gabriel382/series-schedule", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "api/src/routes.js", "max_forks_repo_name": "Gabriel382/series-schedule", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 29.7272727273, "max_line_length": 122, "alphanum_fraction": 0.7655453619}
import { Router } from 'express';
import multer from 'multer';
import multerConfig from './config/multer';

import DeleteController from './app/controllers/DeleteController';
import GetController from './app/controllers/GetController';
import PostController from './app/controllers/PostController';
import PutController from './app/controllers/PutController';
import cookieParser from 'cookie-parser';


const routes = new Router();
const upload = multer(multerConfig);
routes.use(cookieParser());

// Get All Options Available
routes.get('/', GetController.options);

// GET
routes.get('/table=:table/operation=:operation/values=:keyvaluesstring', GetController.index); // CHAVE=VALOR&CHAVE2=VALOR

// POST
routes.post('/table=:table', upload.single('file'), PostController.index);

// PUT
routes.put('/table=:table/values=:keyvaluesstring', PutController.index);

// DELETE
routes.delete('/table=:table/values=:keyvaluesstring', DeleteController.index);


export default routes;
