Skip to content
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

Update README.md #579

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,3 +195,25 @@ Installing in the trust store does not require the CA key, so you can export the
* run `mkcert -install`

Remember that mkcert is meant for development purposes, not production, so it should not be used on end users' machines, and that you should *not* export or share `rootCA-key.pem`.

### Using mkcert with Vite

If you use Vite, you'll need to modify the vite.config.js (or vite.config.ts if you're using TypeScript) to include the HTTPS configuration.

```
import fs from 'fs';
import path from 'path';

export default {
server: {
https: {
key: fs.readFileSync(path.resolve(__dirname, 'path/to/example-key.pem')),
cert: fs.readFileSync(path.resolve(__dirname, 'path/to/example.pem')),
},
// Make sure the server is accessible over the local network
host: '0.0.0.0',
},
};
```

Replace 'path/to/example-key.pem' and 'path/to/example.pem' with the paths to your certificate files.