aboutsummaryrefslogtreecommitdiff
path: root/src/site/store
diff options
context:
space:
mode:
authorPitu <[email protected]>2020-05-09 19:21:20 +0900
committerPitu <[email protected]>2020-05-09 19:21:20 +0900
commitc114e59be329fa9ceb8f1f8e79356a0e3afbd1ae (patch)
treea9166ef288e882452815ed1889186f2fda6b2588 /src/site/store
parentwip: (diff)
downloadhost.fuwn.me-c114e59be329fa9ceb8f1f8e79356a0e3afbd1ae.tar.xz
host.fuwn.me-c114e59be329fa9ceb8f1f8e79356a0e3afbd1ae.zip
Feature:
* Frontend is now served by the API process * Only 1 process spawns for lolisafe to work * Switched frontend from server-side render to static site, now saved in `/dist`
Diffstat (limited to 'src/site/store')
-rw-r--r--src/site/store/index.js15
1 files changed, 3 insertions, 12 deletions
diff --git a/src/site/store/index.js b/src/site/store/index.js
index cf3650f..1fc2272 100644
--- a/src/site/store/index.js
+++ b/src/site/store/index.js
@@ -1,3 +1,4 @@
+import config from '../../../dist/config.json';
export const state = () => ({
loggedIn: false,
user: null,
@@ -26,18 +27,8 @@ export const mutations = {
};
export const actions = {
- async nuxtServerInit({ commit, dispatch }, { app, req }) {
- 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: parseInt(process.env.MAX_SIZE, 10),
- chunkSize: parseInt(process.env.CHUNK_SIZE, 10),
- maxLinksPerAlbum: parseInt(process.env.MAX_LINKS_PER_ALBUM, 10),
- publicMode: process.env.PUBLIC_MODE == 'true' ? true : false,
- enableAccounts: process.env.USER_ACCOUNTS == 'true' ? true : false
- });
+ async nuxtClientInit({ commit, dispatch }, { app, req }) {
+ commit('config', config);
const cookies = this.$cookies.getAll();
if (!cookies.token) return dispatch('logout');