Skip to content

Commit

Permalink
web: debug, api: add BUCKET_NAME env
Browse files Browse the repository at this point in the history
  • Loading branch information
LittleNa1000 committed Nov 1, 2024
1 parent 149ac72 commit 7cfd5f5
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions apps/api/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ ACCESS=
SECRET_KEY=
ENDPOINT=
REGION=
BUCKET_NAME=

INTANIA_AUTH_SECRET=
4 changes: 2 additions & 2 deletions apps/api/src/aws/aws.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export class AwsService {
try {
await this.s3Client.send(
new PutObjectCommand({
Bucket: 'project-tracker',
Bucket: process.env.BUCKET_NAME,
Key: storedFileName,
Body: file,
}),
Expand All @@ -57,7 +57,7 @@ export class AwsService {

async getUrlToFile(fileName: string, folderName?: string): Promise<string> {
const isPdf = fileName.slice(-4) == '.pdf';
const bucketName = 'project-tracker';
const bucketName = process.env.BUCKET_NAME;
const pathToFile = folderName ? `${folderName}/${fileName}` : fileName;
let command: GetObjectCommand;
if (isPdf) {
Expand Down
1 change: 1 addition & 0 deletions apps/web/src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export default function Page() {
ดำเนินการเรื่องเอกสารของคณะฯ ไม่ยุ่งยาก สะดวก รวดเร็ว
ครบจบทุกกระบวนการ มาเริ่มต้นเอกสารกัน !
</h2>
debugs: {env('INTANIA_AUTH_APP_ID')} {process.env.INTANIA_AUTH_APP_ID}
</div>
<Button
className="rounded-[80px] bg-gradient-red text-2xl font-bold px-12 py-[10px] h-16"
Expand Down
6 changes: 4 additions & 2 deletions apps/web/src/app/trpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ export const trpc = createTRPCProxyClient<AppRouter>({
links: [
loggerLink({
enabled: (opts) =>
(env('NEXT_PUBLIC_NODE_ENV') === 'development' && typeof window !== 'undefined') ||
(env('NEXT_PUBLIC_NODE_ENV') === 'development' &&
typeof window !== 'undefined') ||
(opts.direction === 'down' && opts.result instanceof Error),
}),
httpBatchLink({
url: `${env('NEXT_PUBLIC_API_SERVER_URL')}/trpc`,
url: `${env('NEXT_PUBLIC_API_SERVER_URL')}trpc`,
fetch(url, options) {
console.log('fetching', url);
return fetch(url, {
...options,
credentials: 'include',
Expand Down

0 comments on commit 7cfd5f5

Please sign in to comment.