mirror of
https://github.com/wassname/talk.git
synced 2026-07-13 01:18:24 +08:00
20 lines
419 B
JavaScript
20 lines
419 B
JavaScript
const express = require('express');
|
|
const router = express.Router();
|
|
const Setting = require('../../../models/setting');
|
|
|
|
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;
|