nksaraf / vinxi

The Full Stack JavaScript SDK
https://vinxi.vercel.app
MIT License
1.33k stars 56 forks source link

Local HTTPS development with vinxi. #257

Closed birkskyum closed 3 months ago

birkskyum commented 3 months ago

Usually, I'd configure HTTPS inside the vite.server.https, vite.server.host, vite.server.port, and vite.plugins (vite-plugin-mkcert / vite-plugin-basic-ssl)

It seems like vinxi dev is ignoring anything from the vite.server.

nksaraf commented 3 months ago

yup there's no vite server really, its used as a transform pipeline, the server is nitro/h3. For https during dev.. you can set server.https: true (and it probably has other options to configure https

birkskyum commented 3 months ago

Thanks, it does indeed load on HTTPS. The TS didn't recognize the flag, and i need some cert config etc., but good progress

Screenshot 2024-03-16 at 14 46 40 Screenshot 2024-03-16 at 14 46 46
birkskyum commented 2 months ago

@timothyallan , no, i found that https without locally signed certs worked for my use case. There are some env vars that are mentioned here which is probably the way to do it: https://github.com/unjs/nitro/issues/749#issue-1491576157

timothyallan commented 2 months ago

he, I'd just figured it out a few minutes after I posted my now deleted post :)

after a random guess, I tried :

server: {
    https: {
      key: ".cert/mykey.pem",
      cert: ".cert/mycert.pem",
    },

and it worked.

birkskyum commented 2 months ago

So we need types for this in config