shldhee / note

개인노트
0 stars 0 forks source link

nuxt https 적용 #17

Open shldhee opened 2 years ago

shldhee commented 2 years ago

You can use mkcert

  1. Install mkcert:
    brew install mkcert
    brew install nss # if you use Firefox
  2. Add mkcert to your local root CAs:
    mkcert -install
  3. 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
  4. 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/

shldhee commented 2 years ago

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

shldhee commented 2 years ago

https://nuxtjs.org/docs/configuration-glossary/configuration-server/#example-using-https-configuration