chore: add dev containers
This commit is contained in:
+9
-1
@@ -2,10 +2,18 @@ import * as schema from "./schema";
|
||||
import { neonConfig, Pool } from "@neondatabase/serverless";
|
||||
import { drizzle as neonDrizzle } from "drizzle-orm/neon-serverless";
|
||||
|
||||
const isDevContainer = process.env.REMOTE_CONTAINERS !== undefined;
|
||||
|
||||
// if we're running locally
|
||||
if (process.env.VERCEL_ENV !== "production") {
|
||||
// Set the WebSocket proxy to work with the local instance
|
||||
neonConfig.wsProxy = (host) => `${host}:5481/v1`;
|
||||
if (isDevContainer) {
|
||||
// Running inside a VS Code devcontainer
|
||||
neonConfig.wsProxy = (host) => `host.docker.internal:5481/v1`;
|
||||
} else {
|
||||
// Not running inside a VS Code devcontainer
|
||||
neonConfig.wsProxy = (host) => `${host}:5481/v1`;
|
||||
}
|
||||
// Disable all authentication and encryption
|
||||
neonConfig.useSecureWebSocket = false;
|
||||
neonConfig.pipelineTLS = false;
|
||||
|
||||
Reference in New Issue
Block a user