Load enviroment variables into config

This commit is contained in:
Pitu 2019-02-21 23:49:44 +09:00
parent 44e6fd31d2
commit 48d1859723
1 changed files with 9 additions and 3 deletions

View File

@ -39,9 +39,15 @@ const mutations = {
const actions = {
nuxtServerInit({ commit }, { req }) {
/* TODO: Get env variables from context/process */
const config = require('~/config.js');
commit('config', config);
commit('config', {
version: process.env.npm_package_version,
URL: process.env.DOMAIN,
baseURL: `${process.env.DOMAIN}${process.env.ROUTE_PREFIX}`,
serviceName: process.env.SERVICE_NAME,
maxFileSize: process.env.MAX_SIZE,
chunkSize: process.env.CHUNK_SIZE,
maxLinksPerAlbum: process.env.MAX_LINKS_PER_ALBUM
});
}
};