mirror of
https://github.com/wassname/talk.git
synced 2026-07-04 18:15:48 +08:00
23 lines
435 B
JavaScript
23 lines
435 B
JavaScript
const express = require('express');
|
|
const Setting = require('../../../models/setting');
|
|
|
|
const router = express.Router();
|
|
|
|
router.get('/', (req, res, next) => {
|
|
Setting
|
|
.getSettings()
|
|
.then(settings => {
|
|
res.json(settings);
|
|
})
|
|
.catch(next);
|
|
});
|
|
|
|
router.put('/', (req, res, next) => {
|
|
Setting
|
|
.updateSettings(req.body)
|
|
.then(() => res.status(204).end())
|
|
.catch(next);
|
|
});
|
|
|
|
module.exports = router;
|