Docker setup

This commit is contained in:
Ahmed Al-Taiar
2024-10-07 16:00:54 -04:00
parent 835d895fc0
commit 189018cedc
2 changed files with 9 additions and 2 deletions

View File

@ -15,8 +15,8 @@ PRISMA_HIDE_UPDATE_MESSAGE=true
# Ordered by how verbose they are: trace | debug | info | warn | error | silent # Ordered by how verbose they are: trace | debug | info | warn | error | silent
# LOG_LEVEL=debug # LOG_LEVEL=debug
FIRST_NAME=Ahmed FIRST_NAME=firstname
LAST_NAME=Al-Taiar LAST_NAME=lastname
GMAIL=example@gmail.com GMAIL=example@gmail.com
GMAIL_SMTP_PASSWORD=chan geme xyza bcde GMAIL_SMTP_PASSWORD=chan geme xyza bcde

View File

@ -5,6 +5,7 @@ import {
HexColorCodeResolver, HexColorCodeResolver,
} from 'graphql-scalars' } from 'graphql-scalars'
import { isProduction } from '@redwoodjs/api/logger'
import { createAuthDecoder } from '@redwoodjs/auth-dbauth-api' import { createAuthDecoder } from '@redwoodjs/auth-dbauth-api'
import { createGraphQLHandler } from '@redwoodjs/graphql-server' import { createGraphQLHandler } from '@redwoodjs/graphql-server'
@ -32,5 +33,11 @@ export const handler = createGraphQLHandler({
HexColorCode: HexColorCodeResolver, HexColorCode: HexColorCodeResolver,
}, },
}, },
cors: {
origin: isProduction
? [process.env.ADDRESS_PROD, process.env.API_ADDRESS_PROD]
: [process.env.ADDRESS_DEV, process.env.API_ADDRESS_DEV],
credentials: isProduction ? true : false,
},
onException: () => db.$disconnect(), onException: () => db.$disconnect(),
}) })