Spaces:
Sleeping
Sleeping
coyotte508
commited on
Commit
·
29fe8bf
1
Parent(s):
a28b199
allow running on custom port
Browse files- vite.config.ts +4 -0
vite.config.ts
CHANGED
|
@@ -2,6 +2,9 @@ import { sveltekit } from "@sveltejs/kit/vite";
|
|
| 2 |
import Icons from "unplugin-icons/vite";
|
| 3 |
import { promises } from "fs";
|
| 4 |
import { defineConfig } from "vitest/config";
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
// used to load fonts server side for thumbnail generation
|
| 7 |
function loadTTFAsArrayBuffer() {
|
|
@@ -26,6 +29,7 @@ export default defineConfig({
|
|
| 26 |
],
|
| 27 |
// Allow external access via ngrok tunnel host
|
| 28 |
server: {
|
|
|
|
| 29 |
// Allow any ngrok-free.app subdomain (dynamic tunnels)
|
| 30 |
// See Vite server.allowedHosts: string[] | true
|
| 31 |
// Using leading dot matches subdomains per Vite's host check logic
|
|
|
|
| 2 |
import Icons from "unplugin-icons/vite";
|
| 3 |
import { promises } from "fs";
|
| 4 |
import { defineConfig } from "vitest/config";
|
| 5 |
+
import { config } from "dotenv";
|
| 6 |
+
|
| 7 |
+
config({ path: "./.env.local" });
|
| 8 |
|
| 9 |
// used to load fonts server side for thumbnail generation
|
| 10 |
function loadTTFAsArrayBuffer() {
|
|
|
|
| 29 |
],
|
| 30 |
// Allow external access via ngrok tunnel host
|
| 31 |
server: {
|
| 32 |
+
port: process.env.PORT ? parseInt(process.env.PORT) : 5173,
|
| 33 |
// Allow any ngrok-free.app subdomain (dynamic tunnels)
|
| 34 |
// See Vite server.allowedHosts: string[] | true
|
| 35 |
// Using leading dot matches subdomains per Vite's host check logic
|