This commit is contained in:
lesion
2019-07-03 17:22:26 +02:00
parent 3f105aebe5
commit ba23cadba3
4 changed files with 4 additions and 6 deletions

View File

@@ -2,7 +2,7 @@
.container .container
#error #error
h1(v-if="error.statusCode === 404") {{error.message}} h1(v-if="error.statusCode === 404") {{error.message}}
h1(v-else) An error occurred {{error}} h1(v-else) An error occurred: {{error.message}}
</template> </template>
<script> <script>

View File

@@ -173,7 +173,6 @@ const eventController = {
.startOf('month').startOf('isoWeek') .startOf('month').startOf('isoWeek')
let end = moment().utc().year(req.params.year).month(req.params.month).endOf('month') let end = moment().utc().year(req.params.year).month(req.params.month).endOf('month')
const shownDays = end.diff(start, 'days') const shownDays = end.diff(start, 'days')
console.error(shownDays)
if (shownDays <= 35) end = end.add(1, 'week') if (shownDays <= 35) end = end.add(1, 'week')
end = end.endOf('isoWeek') end = end.endOf('isoWeek')
const events = await Event.findAll({ const events = await Event.findAll({

View File

@@ -15,8 +15,6 @@ async function start() {
// Init Nuxt.js // Init Nuxt.js
const nuxt = new Nuxt(nuxt_config) const nuxt = new Nuxt(nuxt_config)
// const { host, port } = nuxt.options.server
// Build only in dev mode // Build only in dev mode
if (nuxt_config.dev) { if (nuxt_config.dev) {
const builder = new Builder(nuxt) const builder = new Builder(nuxt)
@@ -25,10 +23,11 @@ async function start() {
await nuxt.ready() await nuxt.ready()
} }
app.use('/favicon.ico', express.static('/dist/favicon.ico'))
app.use(morgan('dev')) app.use(morgan('dev'))
app.use('/media/', express.static(config.upload_path)) app.use('/media/', express.static(config.upload_path))
app.use('/api', require('./api/index')) app.use('/api', require('./api/index'))
// Give nuxt middleware to express // Give nuxt middleware to express
app.use(nuxt.render) app.use(nuxt.render)

View File

@@ -132,7 +132,7 @@ export const actions = {
async nuxtServerInit ({ commit }, { app, req } ) { async nuxtServerInit ({ commit }, { app, req } ) {
const settings = await app.$axios.$get('/settings') const settings = await app.$axios.$get('/settings')
commit('setSettings', settings) commit('setSettings', settings)
console.error('NUXT SETTINGS', settings) console.error('SETTINGS', settings)
const lang = req.acceptsLanguages('en', 'it') const lang = req.acceptsLanguages('en', 'it')
commit('setLocale', lang || 'it') commit('setLocale', lang || 'it')