Skip to content

Commit

Permalink
make pnpm dev server use docker container
Browse files Browse the repository at this point in the history
  • Loading branch information
anmho committed May 21, 2024
1 parent 25663db commit ad3a592
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .env.development
Original file line number Diff line number Diff line change
@@ -1 +1 @@
DATABASE_URL="postgres://admin:admin@localhost:5434/zotmeal"
DATABASE_URL="postgres://admin:admin@localhost:5433/zotmeal"
3 changes: 3 additions & 0 deletions apps/server/.env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@


DATABASE_URL="postgres://admin:admin@localhost:5433/zotmeal"
2 changes: 1 addition & 1 deletion apps/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"main": "serverless.ts",
"scripts": {
"clean": "rm -rf .turbo node_modules",
"with-env": "dotenv -e ../../.env -- ",
"with-env": "dotenv -e .env.development -- ",
"dev": "pnpm with-env sls offline --noPrependStageInUrl --host 127.0.0.1",
"deploy": "pnpm with-env AWS_PROFILE=icssc sls deploy --stage production",
"test:daily": "pnpm with-env sls invoke local --function updateDaily | pino-pretty",
Expand Down
5 changes: 3 additions & 2 deletions packages/api/src/menus/services/parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ import {
} from "@zotmeal/utils";
import { CampusDishResponseSchema } from "@zotmeal/validators";

import type { GetMenuParams } from "./menu";
import { insertDishMenuStationJoint, upsertDish } from "../../dishes";
import { upsertRestaurant } from "../../restaurants";
import { upsertStation } from "../../stations";
import { GetMenuSchema, upsertMenu } from "./menu";
import { upsertMenu } from "./menu";
import type { GetMenuParams} from '../procedures/getMenu';
import { GetMenuSchema } from '../procedures/getMenu';

export async function getCampusDish(
params: GetMenuParams,
Expand Down
5 changes: 5 additions & 0 deletions packages/api/src/trpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,13 @@
// import { Expo } from "expo-server-sdk";
import { initTRPC } from "@trpc/server";
import superjson from "superjson";
import { assert } from "vitest";
import { ZodError } from "zod";

import { createDrizzle } from "@zotmeal/db";

import { logger } from "../logger";

/**
* 1. CONTEXT
*
Expand All @@ -34,6 +37,8 @@ import { createDrizzle } from "@zotmeal/db";
// accessToken: process.env.EXPO_ACCESS_TOKEN,
// });

logger.debug("trpc api db url: " + process.env.DATABASE_URL);

const db = createDrizzle({ connectionString: process.env.DATABASE_URL });

export const createTRPCContext = (opts: { headers: Headers }) => {
Expand Down

0 comments on commit ad3a592

Please sign in to comment.