start with user favicon/locale personalization
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
const Mastodon = require('mastodon-api')
|
||||
const { setting: Setting } = require('../models')
|
||||
const config = require('config')
|
||||
|
||||
const settingsController = {
|
||||
settings: { initialized: false },
|
||||
secretSettings: {},
|
||||
@@ -36,6 +37,14 @@ const settingsController = {
|
||||
}
|
||||
},
|
||||
|
||||
async getUserLocale(req, res) {
|
||||
// console.error(res)
|
||||
// load user locale specified in configuration
|
||||
// res.json({ about: 'dentro user locale' })
|
||||
// res.sendStatus(200)
|
||||
return false
|
||||
},
|
||||
|
||||
async setRequest(req, res) {
|
||||
const { key, value, is_secret } = req.body
|
||||
const ret = await settingsController.set(key, value, is_secret)
|
||||
|
||||
@@ -85,6 +85,8 @@ api.delete('/event/notification/:code', eventController.delNotification)
|
||||
api.get('/settings', settingsController.getAllRequest)
|
||||
api.post('/settings', jwt, fillUser, isAdmin, settingsController.setRequest)
|
||||
|
||||
api.get('/settings/user_locale', settingsController.getUserLocale)
|
||||
|
||||
// confirm event
|
||||
api.get('/event/confirm/:event_id', jwt, isAuth, isAdmin, eventController.confirm)
|
||||
api.get('/event/unconfirm/:event_id', jwt, isAuth, isAdmin, eventController.unconfirm)
|
||||
|
||||
@@ -23,7 +23,9 @@ async function start() {
|
||||
await nuxt.ready()
|
||||
}
|
||||
|
||||
app.use('/favicon.ico', express.static(path.resolve(__dirname, '../dist/favicon.ico')))
|
||||
// configurable favicon && logo
|
||||
app.use('/favicon.ico', express.static(path.resolve(config.favicon)))
|
||||
|
||||
app.use(morgan('dev'))
|
||||
app.use('/media/', express.static(config.upload_path))
|
||||
app.use('/api', require('./api/index'))
|
||||
@@ -31,7 +33,7 @@ async function start() {
|
||||
// Give nuxt middleware to express
|
||||
app.use(nuxt.render)
|
||||
|
||||
// Listen the server
|
||||
// Listen
|
||||
const server = app.listen(nuxt_config.server)
|
||||
|
||||
// close connections/port/unix socket
|
||||
|
||||
Reference in New Issue
Block a user