Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c8329f6

Browse files
authored
Merge pull request #7 from coderplex/dotenv
Setup proxy in now
2 parents 0973ea5 + c6a6596 commit c8329f6

File tree

6 files changed

+21
-7
lines changed

6 files changed

+21
-7
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,5 @@ yarn-error.log*
1919
*.njsproj
2020
*.sln
2121
*.sw?
22+
23+
.env

now.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"routes": [
3+
{
4+
"src": "/api/(.*)",
5+
"dest": "https://openrank.herokuapp.com/api/$1"
6+
}
7+
]
8+
}

src/store/modules/authentication/login.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,13 @@ export default {
3737
email,
3838
password,
3939
}).then(({ data: { data: { token }, message } }) => {
40-
console.log('TOKEN', token);
4140
commit('authentication/user/setToken', token, { root: true });
4241
commit('setSuccessMsg', message);
42+
setTimeout(() => commit('setSuccessMsg', null), 2000);
4343
router.push('/').catch(() => {});
4444
}).catch(({ response }) => {
45-
console.log('CAME HERE');
4645
commit('setErrorMsg', rootGetters.getErrorMessage(response));
47-
console.log(response);
46+
setTimeout(() => commit('setErrorMsg', null), 2000);
4847
});
4948
},
5049
},

src/store/modules/authentication/register.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,10 @@ export default {
5050
password_confirmed,
5151
}).then(({ data: { message } }) => {
5252
commit('setSuccessMsg', message);
53+
setTimeout(() => commit('setSuccessMsg', null), 2000);
5354
}).catch(({ response }) => {
5455
commit('setErrorMsg', rootGetters.getErrorMessage(response));
55-
console.log(response);
56+
setTimeout(() => commit('setErrorMsg', null), 2000);
5657
});
5758
},
5859
},

src/store/modules/authentication/user.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,10 @@ export default {
5858
commit('setName', name);
5959
commit('setEmail', email);
6060
commit('setSuccessMsg', message);
61+
setTimeout(() => commit('setSuccessMsg', null), 2000);
6162
}).catch(({ response }) => {
6263
commit('setErrorMsg', rootGetters.getErrorMessage(response));
63-
console.log(response);
64+
setTimeout(() => commit('setErrorMsg', null), 2000);
6465
});
6566
},
6667
async updateUser({
@@ -88,9 +89,10 @@ export default {
8889
commit('setName', user.name);
8990
commit('setEmail', user.email);
9091
commit('setSuccessMSg', message);
92+
setTimeout(() => commit('setSuccessMsg', null), 2000);
9193
}).catch(({ response }) => {
9294
commit('setErrorMsg', rootGetters.getErrorMessage(response));
93-
console.log(response);
95+
setTimeout(() => commit('setErrorMsg', null), 2000);
9496
});
9597
},
9698
},

vue.config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ module.exports = {
22
devServer: {
33
proxy: {
44
'/api': {
5-
target: 'http://localhost:8000',
5+
target: 'https://localhost:8000',
6+
ws: true,
7+
changeOrigin: true,
68
headers: {
79
Connection: 'keep-alive',
810
},

0 commit comments

Comments
 (0)