New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(core, cli): builtin support of https and unix sockets #3831
Conversation
The parameter could be `true` or options from https://nodejs.org/api/https.html#https_https_createserver_options_requestlistener
@pi0 @clarkdo followed your advice to the best of my judgement on https://github.com/nuxt/nuxt.js/pull/3812/files and https://github.com/nuxt/nuxt.js/pull/3403/files -- let me know if you have any additional feedback before I proceed to adding tests. |
Codecov Report
@@ Coverage Diff @@
## dev #3831 +/- ##
==========================================
- Coverage 97.84% 97.79% -0.06%
==========================================
Files 18 18
Lines 1162 1181 +19
Branches 317 324 +7
==========================================
+ Hits 1137 1155 +18
- Misses 24 25 +1
Partials 1 1
Continue to review full report at Codecov.
|
lib/core/nuxt.js
Outdated
const isHttps = !!this.options.http | ||
|
||
if (isHttps) { | ||
const httpsOptions = this.options.https === true ? {} : this.options.http |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest using options.server.*
as well as setting defaults inside [nuxt.config.js](https://github.com/nuxt/nuxt.js/blob/dev/lib/common/nuxt.config.js#L18_
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pi0 good call, thanks!
lib/core/nuxt.js
Outdated
|
||
let appServer | ||
const isHttps = !!this.options.http | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use either http
or https
options!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pi0 ops, that's a typo indeed!
@@ -77,8 +79,8 @@ if (nuxt.options.render.ssr === true) { | |||
} | |||
} | |||
|
|||
const { port, host } = nuxt.options.server | |||
const { port, host, socket } = getLatestHost(argv) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we add it to nuxt-dev
too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pi0 good catch.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
TODO: