<commit_before>var express = require('express');
var cors = require('cors');

var situations = require('../controllers/situations');
var teleservices = require('../controllers/teleservices');

module.exports = function(api) {
    api.route('/situations').post(situations.create);

    var route = new express.Router({ mergeParams: true });
    route.use(situations.validateAccess);

    route.get('/', situations.show);
    route.get('/openfisca-response', situations.openfiscaResponse);
    route.get('/legacy-openfisca-request', situations.openfiscaRequestFromLegacy);

    // Enable CORS for openfisca-tracer
    route.options('/openfisca-request', cors());
    route.get('/openfisca-request', cors({ origin: '*' }), situations.openfiscaRequest);

    route.post('/openfisca-test', situations.openfiscaTest);
    route.get('/openfisca-trace', situations.openfiscaTrace);

    teleservices.names.forEach(function(name) {<commit_msg>Ajoute cookie-parser dans l'API<commit_after>var express = require('express');
var cookieParser = require('cookie-parser');
var cors = require('cors');

var situations = require('../controllers/situations');
var teleservices = require('../controllers/teleservices');

module.exports = function(api) {
    api.route('/situations').post(situations.create);

    var route = new express.Router({ mergeParams: true });
    route.use(cookieParser());
    route.use(situations.validateAccess);

    route.get('/', situations.show);
    route.get('/openfisca-response', situations.openfiscaResponse);
    route.get('/legacy-openfisca-request', situations.openfiscaRequestFromLegacy);

    // Enable CORS for openfisca-tracer
    route.options('/openfisca-request', cors());
    route.get('/openfisca-request', cors({ origin: '*' }), situations.openfiscaRequest);

    route.post('/openfisca-test', situations.openfiscaTest);
    route.get('/openfisca-trace', situations.openfiscaTrace);

    teleservices.names.forEach(function(name) {
{'fraction_non_alphanumeric': 0.1636085626911315, 'fraction_numerical': 0.0, 'mean_word_length': 4.948484848484848, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5974049', 'n_tokens_mistral': 614, 'n_tokens_neox': 605, 'n_words': 93}