Skip to content

Commit

Permalink
fix: use local ip instead of 'localhost' to support mobile device
Browse files Browse the repository at this point in the history
  • Loading branch information
mvayngrib committed Feb 13, 2018
1 parent 862bf13 commit 562f633
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/aws-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ export const createConfig = ({ env } : { env: Env }):IAWSServiceConfig => {
} as IAWSServiceConfig

if (IS_LOCAL || IS_OFFLINE) {
const localIP = require('localip')()
const localstackEndpoints = require('./test/localstack')

for (let name in localstackEndpoints) {
let lname = name.toLowerCase()
if (!services[lname]) services[lname] = {}

services[lname].endpoint = localstackEndpoints[name]
let endpoint = localstackEndpoints[name]
services[lname].endpoint = endpoint.replace(/localhost/, localIP)
}

services.s3.s3ForcePathStyle = true
Expand Down

0 comments on commit 562f633

Please sign in to comment.