Quantcast
Channel: Active questions tagged svelte - Stack Overflow
Viewing all articles
Browse latest Browse all 1541

How to deploy Sveltekit app in node server with HTTPS?

$
0
0

I'm want to deploy my Sveltekit app on HTTPS server. I have key files also. This is my svelte.config.js file

import preprocess from 'svelte-preprocess';import node from '@sveltejs/adapter-node';import fs from 'fs';import https from 'https';/** @type {import('@sveltejs/kit').Config} **/const config = {    // Consult https://github.com/sveltejs/svelte-preprocess    // for more information about preprocessors    preprocess: preprocess(),    kit: {        // hydrate the <div id="svelte"> element in src/app.html        target: '#svelte',        adapter: node(),        files: { assets: "static" },        vite: {          server: {            https: {              key: fs.readFileSync("path\\privkey.pem"),              cert: fs.readFileSync("path\\cert.pem"),            },          },        }    }};export default config;

where should I keep my key files for reading from the config file? I tried a few and got some errors screenshot is attached.enter image description here

enter image description here

Someone please guide me. Thanks in advance.


Viewing all articles
Browse latest Browse all 1541

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>