feat: Serve static assets of apps
This commit is contained in:
@@ -11,7 +11,9 @@ type AppConfig = {
|
||||
postgresPort: number,
|
||||
postgresHost: string,
|
||||
postgresUsername: string,
|
||||
postgresPassword: string
|
||||
postgresPassword: string,
|
||||
baseUrl?: string
|
||||
webAppUrl?: string
|
||||
}
|
||||
|
||||
const appConfig: AppConfig = {
|
||||
@@ -27,4 +29,10 @@ const appConfig: AppConfig = {
|
||||
postgresPassword: process.env.POSTGRESS_PASSWORD,
|
||||
}
|
||||
|
||||
const webAppUrl = `${appConfig.protocol}://${appConfig.host}:${appConfig.corsPort}`;
|
||||
appConfig.webAppUrl = webAppUrl;
|
||||
|
||||
const baseUrl = `${appConfig.protocol}://${appConfig.host}:${appConfig.port}`;
|
||||
appConfig.baseUrl = baseUrl;
|
||||
|
||||
export default appConfig;
|
||||
|
@@ -1,7 +1,7 @@
|
||||
import appConfig from './app'
|
||||
|
||||
const corsOptions = {
|
||||
origin: `${appConfig.protocol}://${appConfig.host}:${appConfig.corsPort}`,
|
||||
origin: appConfig.webAppUrl,
|
||||
methods: 'POST',
|
||||
credentials: true,
|
||||
optionsSuccessStatus: 200,
|
||||
|
Reference in New Issue
Block a user