Skip to content

Commit 6bdfb8c

Browse files
committed
Fixed: #1 & add HTTPS env option for https production
1 parent 6305d23 commit 6bdfb8c

5 files changed

Lines changed: 30 additions & 7 deletions

File tree

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,13 @@ The `.env` file looks like:
5050
GH_TOKEN=Your token here
5151
JWT_SECRET=Any string
5252
KOA_PORT=8888
53+
HTTPS=false
5354
```
5455

5556
> KOA_PORT can be any port you like which is available.
5657
58+
**If you set `HTTPS=true`, then the websocket will connect the 443 port, it's useful for https production.**
59+
5760
### Run
5861

5962
```bash

config/dev.env.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@ const merge = require('webpack-merge')
44
const prodEnv = require('./prod.env')
55
module.exports = merge(prodEnv, {
66
NODE_ENV: '"development"',
7-
KOA_PORT: `${process.env.KOA_PORT || 443}`
7+
KOA_PORT: `${process.env.KOA_PORT || 443}`,
8+
HTTPS: `${process.env.HTTPS}`
89
})

config/prod.env.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
require('dotenv').config({silent: true})
33
module.exports = {
44
NODE_ENV: '"production"',
5-
KOA_PORT: `${process.env.KOA_PORT || 443}`
5+
KOA_PORT: `${process.env.KOA_PORT || 443}`,
6+
HTTPS: `${process.env.HTTPS}`
67
}

src/App.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ export default {
3636
created () {
3737
const host = window.location.hostname
3838
const protocol = window.location.protocol
39-
const port = process.env.KOA_PORT || 443
39+
let port = process.env.KOA_PORT
40+
if (process.env.HTTPS) {
41+
port = 443
42+
}
4043
const socket = io(`${protocol}//${host}:${port}`)
4144
socket.on('limit', (data) => {
4245
this.limit = data.rateLimit

src/views/Profile.vue

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,26 @@
1212
.user-info__cards.pull-left
1313
.col-xs-12.col-sm-6.col-lg-3
1414
.user-info__card
15-
| {{ userInfo.email || 'Null' }}
15+
span.user-info__card-text(:class="{'small-text': userInfo.email && userInfo.email.length > 21}")
16+
| {{ userInfo.email || 'Null' }}
1617
.user-info__card-status.pull-right
1718
i.fa.fa-envelope(aria-hidden="true")
1819
.col-xs-12.col-sm-6.col-lg-3
1920
.user-info__card
20-
| Joined at {{ userInfo.createdAt.slice(0, 10) }}
21+
span.user-info__card-text
22+
| Joined at {{ userInfo.createdAt.slice(0, 10) }}
2123
.user-info__card-status.pull-right
2224
i.fa.fa-calendar(aria-hidden="true")
2325
.col-xs-12.col-sm-6.col-lg-3
2426
.user-info__card
25-
| Owned public repos
27+
span.user-info__card-text
28+
| Owned public repos
2629
.user-info__card-status.pull-right
2730
| {{ userRepos.totalCount }}
2831
.col-xs-12.col-sm-6.col-lg-3
2932
.user-info__card
30-
| Contributed last year
33+
span.user-info__card-text
34+
| Contributed last year
3135
.user-info__card-status.pull-right
3236
| {{ userCommits.total }}
3337
.row.chart-lists.user-contribution
@@ -321,6 +325,17 @@ export default {
321325
color #4c4948
322326
margin-bottom 15px
323327
font-size 18px
328+
display: flex;
329+
justify-content: center;
330+
align-items: center;
331+
flex-flow: column wrap;
332+
&-text
333+
width calc(100% - 56px)
334+
word-wrap: break-word
335+
line-height: 20px
336+
padding-left 4px
337+
&.small-text
338+
font-size 16px
324339
&-status
325340
text-align center
326341
width 56px

0 commit comments

Comments
 (0)