Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
node-sample
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
周韬
node-sample
Commits
0f13c380
Commit
0f13c380
authored
Jun 07, 2017
by
Sebastien Chopin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add https redirect
parent
eb10c77e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
5 deletions
+18
-5
default.vue
layouts/default.vue
+1
-1
https.js
middleware/https.js
+6
-0
nuxt.config.js
nuxt.config.js
+4
-1
yarn.lock
yarn.lock
+7
-3
No files found.
layouts/default.vue
View file @
0f13c380
...
...
@@ -37,7 +37,7 @@
z-index: 1000 !important
.header
background-color #
2B8358
background-color #
188269
position fixed
z-index 999
height 55px
...
...
middleware/https.js
0 → 100644
View file @
0f13c380
export
default
({
isDev
,
req
,
redirect
})
=>
{
// Redirect to https
if
(
!
isDev
&&
req
&&
!
req
.
connection
.
encrypted
)
{
return
redirect
(
301
,
`https://
${
req
.
headers
.
host
}${
req
.
url
}
`
)
}
}
nuxt.config.js
View file @
0f13c380
...
...
@@ -16,7 +16,7 @@ module.exports = {
]
},
loading
:
{
color
:
'#
66e8ad
'
color
:
'#
59cc93
'
},
manifest
:
{
name
:
'Nuxt Hacker News'
,
...
...
@@ -31,6 +31,9 @@ module.exports = {
'~plugins/vuex-router-sync.js'
,
'~plugins/filters.js'
],
router
:
{
middleware
:
[
'https'
]
},
render
:
{
static
:
{
maxAge
:
'1y'
,
...
...
yarn.lock
View file @
0f13c380
...
...
@@ -1988,8 +1988,8 @@ global@~4.3.0:
process "~0.5.1"
globals@^9.0.0:
version "9.1
7
.0"
resolved "https://registry.yarnpkg.com/globals/-/globals-9.1
7.0.tgz#0c0ca696d9b9bb694d2e5470bd37777caad50286
"
version "9.1
8
.0"
resolved "https://registry.yarnpkg.com/globals/-/globals-9.1
8.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a
"
graceful-fs@^4.1.2, graceful-fs@^4.1.6:
version "4.1.11"
...
...
@@ -3849,7 +3849,11 @@ rx@^4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/rx/-/rx-4.1.0.tgz#a5f13ff79ef3b740fe30aa803fb09f98805d4782"
safe-buffer@^5.0.1, safe-buffer@~5.0.1:
safe-buffer@^5.0.1:
version "5.1.0"
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.0.tgz#fe4c8460397f9eaaaa58e73be46273408a45e223"
safe-buffer@~5.0.1:
version "5.0.1"
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.0.1.tgz#d263ca54696cd8a306b5ca6551e92de57918fbe7"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment