mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-02-03 12:29:46 +08:00
101c227599
* Add no frontend script * Define context middleware * Define base configuration schema * Define configuration DAO * Setup context middleware and live configuration fetch * Remove patch configuration method * Rename files for consistency * Use plain object check * Use plain object * modified base configuration * renamed config property * brought back 2 properties Co-authored-by: Miodec <bartnikjack@gmail.com>
13 lines
280 B
JavaScript
13 lines
280 B
JavaScript
const ConfigurationDAO = require("../dao/configuration");
|
|
|
|
async function contextMiddleware(req, res, next) {
|
|
const configuration = await ConfigurationDAO.getCachedConfiguration(true);
|
|
|
|
req.context = {
|
|
configuration,
|
|
};
|
|
|
|
next();
|
|
}
|
|
|
|
module.exports = contextMiddleware;
|