fix lambda CORS

Signed-off-by: Andrey Platov <andrey@hardcoreeng.com>
This commit is contained in:
Andrey Platov
2021-08-08 17:10:36 +02:00
parent ce348f1a92
commit 67940e0d35
4 changed files with 12 additions and 7 deletions
+5 -5
View File
@@ -106,11 +106,11 @@ const api = new awsx.apigateway.API("login", {
const result = handle(body, serverEndpoint.get())
return {
statusCode: result.statusCode,
// headers: {
// "Access-Control-Allow-Headers" : "Content-Type",
// "Access-Control-Allow-Origin": "*",
// "Access-Control-Allow-Methods": "GET,HEAD,POST"
// },
headers: {
"Access-Control-Allow-Headers" : "Content-Type",
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Methods": "OPTIONS,POST"
},
body: result.body
}
},
+3
View File
@@ -0,0 +1,3 @@
APP_ACCOUNTS_URL=https://ftwm71rwag.execute-api.us-west-2.amazonaws.com/stage/
+3 -1
View File
@@ -36,8 +36,10 @@ import { setMetadata } from '@anticrm/platform'
export function configurePlatform() {
console.log(process.env.APP_ACCOUNTS_URL)
// setMetadata(login.metadata.AccountsUrl, 'https://ftwm71rwag.execute-api.us-west-2.amazonaws.com/stage/')
setMetadata(login.metadata.AccountsUrl, '/api')
setMetadata(login.metadata.AccountsUrl, process.env.APP_ACCOUNTS_URL)
// if (process.env.CLIENT === 'dev')
addLocation(clientId, () => import(/* webpackChunkName: "client-dev" */ '@anticrm/dev-client-resources'))
+1 -1
View File
@@ -152,7 +152,7 @@ module.exports = {
new MiniCssExtractPlugin({
filename: '[name].css'
}),
new Dotenv()
new Dotenv({path: prod ? '.env-prod' : '.env'})
],
devtool: prod ? false : 'source-map',
devServer: {