Closed itsMattShull closed 6 years ago
This issue as been imported as question since it does not respect express-template issue template. Only bug reports and feature requests stays open to reduce maintainers workload. If your issue is not a question, please mention the repo admin or moderator to change its type and it will be re-opened automatically. Your question is available at https://cmty.app/nuxt/express-template/issues/c99.
I'd like to see if anyone else has had success and whether there's an "official way" to do this. In order to get it working I had to first create an key and cert using the following command
Then I created a
server.js
file in the project with the following codeAnd finally I changed the
npm run dev
command fromnuxt
toNODE_ENV=development node server.js
inpackage.json
When you run dev for the first time it'll say the site isn't secure when you go to https://localhost:3000. I used the following instructions to allow the cert.pem file to be trusted by my machine: https://stackoverflow.com/questions/7580508/getting-chrome-to-accept-self-signed-localhost-certificate#answer-15076602
Is there any reason not to do it this way? If so, what's the best way? Thanks!