<commit_before>"use strict";
const express = require('express');
const secrets = require('./secrets');
const api = express.Router();

// LOGIN
api.post('/login', (req, res) => {
    res.sendStatus(200);
});

// KWIZ/CREATE
api.get('/kwiz/create', (req, res) => {
    const response = {
        code: "CHARACTERS"
    };
    res.status(200).send(JSON.stringify(response));
});

// KWIZ/CODE
api.get('/kwiz/:code', (req, res) => {
    const response = {
        status: "open"
    };
    res.status(200).send(JSON.stringify(response));
});

// CATEGORIES
api.get('/categories', (req, res) => {
    const response = [
        {
            categoryName: "eerste categorie"
        }, {
            categoryName: "DIEREN"
        }, {
            categoryName: "derde categorie"
        }
    ];
    res.status(200).send(JSON.stringify(response));
});

// QUESTIONS
api.get('/questions', (req, res) => {
    const response = [
        {
            _id: "iets",
            question: "Hoeveel tenen heeft een geit?",
            answer: "veel",
            category: "DIEREN"
        }, {
            _id: "idieeeee",
            question: "Wat doet de wasmachine?",
            answer: "kfhkjfhakjhak",
            category: "eerste categorie"
        }
    ];
    res.status(200).send(JSON.stringify(response));
});

// QUESTIONS/CATEGORYNAME/QUESTIONS
api.get('/questions/:categoryName/questions', (req, res) => {
    const response = {
        category: "DIEREN",
        questions: [
            {
                _id: "iets",
                question: "Hoeveel tenen heeft een geit?",
                answer: "veel"
            },
            {
                _id: "shdasjkdhsajkdh",
                question: "Hoeveel dieren heeft Freek Vonk doodgestoken?",
                answer: "Eén hele grote vis"
            }
        ]
    };
    res.status(200).send(JSON.stringify(response));
});


// QUESTIONS/ID
api.get('/questions/:id', (req, res) => {
    const response = {
        question: "Hoeveel tenen heeft een geit?",
        category: "DIEREN"
    };
    res.status(200).send(JSON.stringify(response));
});

// KWIZMEESTERT-QUESTIONS/ID
api.get('/kwizmeestert-questions/:id', (req, res) => {
    const response = {
        question: "Hoeveel tenen heeft een geit?",
        answer: "veel",
        category: "DIEREN"
    };
    res.status(200).send(JSON.stringify(response));
});

module.exports = api;<commit_msg>Updated API<commit_after>"use strict";
const express = require('express');
const secrets = require('./secrets');
const api = express.Router();

// LOGIN
api.post('/login', (req, res) => {
    res.sendStatus(200);
});

// KWIZ/CREATE
api.post('/kwiz/create', (req, res) => {
    const response = {
        code: "CHARACTERS"
    };
    res.status(200).send(JSON.stringify(response));
});

// KWIZ/CODE
api.get('/kwiz/:code', (req, res) => {
    const response = {
        status: "open"
    };
    res.status(200).send(JSON.stringify(response));
});

// CATEGORIES
api.get('/categories', (req, res) => {
    const response = [
        {
            categoryName: "eerste categorie"
        }, {
            categoryName: "DIEREN"
        }, {
            categoryName: "derde categorie"
        }
    ];
    res.status(200).send(JSON.stringify(response));
});

// CATEGORIES/CATEGORYNAME/QUESTIONS
api.get('/categories/:categoryName/questions', (req, res) => {
    const response = {
        category: "DIEREN",
        questions: [
            {
                _id: "iets",
                question: "Hoeveel tenen heeft een geit?",
                answer: "veel"
            },
            {
                _id: "shdasjkdhsajkdh",
                question: "Hoeveel dieren heeft <NAME> doodgestoken?",
                answer: "Eén hele grote vis"
            }
        ]
    };
    res.status(200).send(JSON.stringify(response));
});

// QUESTIONS/ID
api.get('/questions/:id', (req, res) => {
    const response = {
        question: "Hoeveel tenen heeft een geit?",
        category: "DIEREN"
    };
    res.status(200).send(JSON.stringify(response));
});

module.exports = api;
{'fraction_non_alphanumeric': 0.1670318967616265, 'fraction_numerical': 0.010226442658875092, 'mean_word_length': 2.042962962962963, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 18, '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': '2411798', 'n_tokens_mistral': 1395, 'n_tokens_neox': 1319, 'n_words': 247}