<commit_before>import express from 'express';
import {addAction} from '../lib/database';
import ModelStore from '../store/model-store';

let app = express();

app.get('/', (req, res) => {
    let model = ModelStore.getModelById(req.query.id);
    res.successJson({
        model: {
            address: model.address,
            name: model.name
        }
    });
});
app.get('/all-models', (req, res) => {
    res.successJson({
        models: ModelStore.getAllModels()
    });
});
app.post('/', (req, res) => {
    addAction('NEW_MODEL', {
        name: req.body.name
    })
        .then(actionId => {
            let model = ModelStore.getModelByActionId(actionId);
            res.successJson({
                address: model.address
            });
        })
        .catch(e => {
            res.failureJson(e.message);
        });
});

export default app;
<commit_msg>Fix the things Jordan didn't<commit_after>import express from 'express';
import { addAction } from '../lib/database';
import ModelStore from '../store/model-store';

let app = express();

app.get('/', (req, res) => {
    let model = ModelStore.getModelById(req.query.id);
    res.successJson({
        model: {
            address: model.address,
            name: model.name
        }
    });
});
app.get('/all', (req, res) => {
    res.successJson({
        models: ModelStore.getAllModels()
    });
});
app.post('/', (req, res) => {
    addAction('NEW_MODEL', {
        name: req.body.name
    })
        .then(actionId => {
            let model = ModelStore.getModelByActionId(actionId);
            res.successJson({
                address: model.address
            });
        })
        .catch(e => {
            res.failureJson(e.message);
        });
});

export default app;

{'fraction_non_alphanumeric': 0.16761041902604756, 'fraction_numerical': 0.0, 'mean_word_length': 1.994915254237288, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '6564981', 'n_tokens_mistral': 535, 'n_tokens_neox': 531, 'n_words': 106}