Skip to content
This repository was archived by the owner on Apr 13, 2024. It is now read-only.

Commit e515a34

Browse files
committed
- implement new script to test compiled (and served from "server") version of vuegg in local. - implement NotFound component (due vue-router history-mode)
- fix fallback routing for history-api (vue-router history mode).
1 parent bd4f71f commit e515a34

File tree

12 files changed

+80
-17
lines changed

12 files changed

+80
-17
lines changed

client/config/dev.env.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ var prodEnv = require('./prod.env')
33

44
module.exports = merge(prodEnv, {
55
NODE_ENV: '"development"',
6-
CLIENT_ID: '"116bed3e72c3aab96b76"',
7-
CALLBACK_URL: '"http://localhost:8080/auth"'
6+
CLIENT_ID: '116bed3e72c3aab96b76',
7+
CALLBACK_URL: 'http://localhost:8080/auth'
88
})

client/config/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ module.exports = {
2727
autoOpenBrowser: true,
2828
assetsSubDirectory: 'static',
2929
assetsPublicPath: '/',
30+
// Development backend server
3031
proxyTable: {
3132
'/api': {
3233
target: 'http://localhost:5000',

client/config/prod.env.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module.exports = {
22
NODE_ENV: '"production"',
3-
CLIENT_ID: '"be437b3a1e6ac9b93c05"',
4-
CALLBACK_URL: '"https://vuegg.now.sh/auth"'
3+
CLIENT_ID: 'be437b3a1e6ac9b93c05',
4+
CALLBACK_URL: 'https://vuegg.now.sh/auth'
55
}

client/config/test.env.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ var devEnv = require('./dev.env')
33

44
module.exports = merge(devEnv, {
55
NODE_ENV: '"testing"',
6-
CLIENT_ID: '"116bed3e72c3aab96b76"',
7-
CALLBACK_URL: '"http://localhost:8080/auth"'
6+
CLIENT_ID: '5e8f72ec1e4a789d8632',
7+
CALLBACK_URL: 'http://localhost:5000/auth'
88
})

client/src/App.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<template>
22
<div id="layout-container" class="mdc-theme--background">
33
<div id="app">
4+
<mdc-linear-progress v-show="loading" class="linear-loader" accent indeterminate></mdc-linear-progress>
45
<headegg :scroll0="notScrolled"></headegg>
56

67
<drawegg></drawegg>
@@ -9,7 +10,6 @@
910
<router-view></router-view>
1011
</main>
1112

12-
<mdc-linear-progress v-show="loading" class="loader" accent indeterminate></mdc-linear-progress>
1313
<page-dialog></page-dialog>
1414
<block-loader></block-loader>
1515
<mdc-snackbar :dismisses-on-action="false"/>
@@ -73,13 +73,13 @@ export default {
7373
height: 100%;
7474
}
7575
76-
.loader {
76+
.linear-loader {
7777
top: 0;
7878
left: 0;
79-
height: 2px;
8079
width: 100%;
81-
position: absolute;
8280
z-index: 1001;
81+
height: 2px !important;
82+
position: absolute !important;
8383
}
8484
8585
#app {

client/src/components/404/index.vue

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<template>
2+
<div class="not-found">
3+
404 - Not found
4+
</div>
5+
</template>
6+
7+
8+
<script>
9+
export default { name: 'not-found' }
10+
</script>
11+
12+
13+
<style scoped>
14+
.not-found {
15+
font-size: 47px;
16+
text-align: center;
17+
margin: 0 57px;
18+
width: 100%;
19+
height: 100%;
20+
}
21+
</style>

client/src/router/index.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import Vue from 'vue'
22
import Router from 'vue-router'
33
import Mainegg from '@/components/main'
4+
import NotFound from '@/components/404'
45

56
Vue.use(Router)
67

@@ -13,8 +14,10 @@ export default new Router({
1314
component: Mainegg
1415
}, {
1516
path: '/auth',
16-
name: 'auth',
17-
component: Mainegg
17+
redirect: { name: 'main' }
18+
}, {
19+
path: '*',
20+
component: NotFound
1821
}
1922
]
2023
})

oauth-config.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
const inquirer = require('inquirer')
22
const shell = require('shelljs')
3-
4-
require('dotenv').config()
3+
const dotenv = require('dotenv')
54

65
const setupQuestions = [
76
{
@@ -11,13 +10,19 @@ const setupQuestions = [
1110
choices: [
1211
'client',
1312
'server',
14-
'start',
15-
'vuegg'
13+
new inquirer.Separator(),
14+
'vuegg:test'
1615
]
1716
}
1817
]
1918

2019
inquirer.prompt(setupQuestions).then(answers => {
20+
if (answers.runScript === 'vuegg:test') {
21+
dotenv.config({path: '.env.test'})
22+
} else {
23+
dotenv.config({path: '.env.dev'})
24+
}
25+
2126
const execCommand = 'CLIENT_ID='.concat(process.env.CLIENT_ID)
2227
.concat(' CLIENT_SECRET=').concat(process.env.CLIENT_SECRET)
2328
.concat(' CALLBACK_URL=').concat(process.env.CALLBACK_URL)

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"scripts": {
77
"oauth": "node oauth-config.js",
88
"vuegg": "npm run install:all && npm run build && npm run start",
9+
"vuegg:test": "npm run build && npm run start",
910
"install:all": "npm run install:client && npm run install:server",
1011
"install:client": "cd client && npm install",
1112
"install:server": "cd server && npm install",

server/package-lock.json

Lines changed: 30 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)