Skip to content

Commit

Permalink
fix: production deployment fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilipOyelegbin committed Dec 14, 2024
1 parent 8aaa170 commit 885c85d
Show file tree
Hide file tree
Showing 4 changed files with 184 additions and 5 deletions.
176 changes: 176 additions & 0 deletions movie_api/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion movie_api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"start": "nest start",
"start:dev": "nest start --watch",
"start:debug": "nest start --debug --watch",
"start:prod": "node dist/main",
"start:prod": "node dist/src/main",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
"test": "jest",
"test:watch": "jest --watch",
Expand All @@ -31,13 +31,15 @@
"@nestjs/passport": "^10.0.3",
"@nestjs/platform-express": "^10.0.0",
"@nestjs/swagger": "^8.0.7",
"@prisma/adapter-pg": "^6.0.1",
"@prisma/client": "^5.22.0",
"argon2": "^0.41.1",
"aws-sdk": "^2.1692.0",
"class-transformer": "^0.5.1",
"class-validator": "^0.14.1",
"passport": "^0.7.0",
"passport-jwt": "^4.0.1",
"pg": "^8.13.1",
"reflect-metadata": "^0.2.0",
"rxjs": "^7.8.1",
"stripe": "^17.4.0"
Expand Down
3 changes: 2 additions & 1 deletion movie_api/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
// Try Prisma Accelerate: https://pris.ly/cli/accelerate-init

generator client {
provider = "prisma-client-js"
provider = "prisma-client-js"
previewFeatures = ["driverAdapters"]
}

datasource db {
Expand Down
6 changes: 3 additions & 3 deletions movie_api/src/movie/movie.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export class MovieService {
const movie = await this.prisma.movie.findMany();

const moviesWithImage = movie.map((list) => {
const cover_image = `${process.env.S3_API}/${list.cover_image}`;
const cover_image = `${process.env.R2_PUBLIC_ENDPOINT}/${list.cover_image}`;
return {
...list,
cover_image,
Expand All @@ -78,7 +78,7 @@ export class MovieService {
'Movie with the provdied ID does not exist.',
);

const cover_image = `${process.env.S3_API}/${movie.cover_image}`;
const cover_image = `${process.env.R2_PUBLIC_ENDPOINT}/${movie.cover_image}`;

return { ...movie, cover_image };
} catch (error) {
Expand Down Expand Up @@ -142,7 +142,7 @@ export class MovieService {

// Construct the full movie image URL
const fullMovieImage = updatedMovie.cover_image
? `${process.env.S3_API}/${updatedMovie.cover_image}`
? `${process.env.R2_PUBLIC_ENDPOINT}/${updatedMovie.cover_image}`
: null;

return {
Expand Down

0 comments on commit 885c85d

Please sign in to comment.