mirror of
https://github.com/wassname/talk.git
synced 2026-08-02 13:10:23 +08:00
15 lines
410 B
JavaScript
15 lines
410 B
JavaScript
const express = require('express');
|
|
const router = express.Router();
|
|
const path = require('path');
|
|
const Setting = require(path.resolve(__dirname, 'models/setting'));
|
|
|
|
router.get('/settings', (req, res, next) => {
|
|
Setting.getSettings().then(res.json).catch(next);
|
|
});
|
|
|
|
router.put('/settings', (req, res, next) => {
|
|
Setting.updateSettings(req.body).then(res.json).catch(next);
|
|
});
|
|
|
|
module.exports = router;
|