shldhee/note

nuxt https 적용

Opened this issue · 2 comments

You can use mkcert

  1. Install mkcert:
brew install mkcert
brew install nss # if you use Firefox
  1. Add mkcert to your local root CAs:
mkcert -install
  1. In your terminal, navigate to your site's root directory or whichever directory you'd like the certificates to be located at. And run:
mkcert localhost
  1. Add the following to your nuxt.config.js:
    server: {
        https: {
            key: fs.readFileSync(path.resolve(__dirname, 'localhost-key.pem')),
            cert: fs.readFileSync(path.resolve(__dirname, 'localhost.pem'))
        }
    }

https://web.dev/how-to-use-local-https/