Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuring API domains via output variables? #22

Open
gregsabo opened this issue Jan 27, 2021 · 0 comments
Open

Configuring API domains via output variables? #22

gregsabo opened this issue Jan 27, 2021 · 0 comments

Comments

@gregsabo
Copy link

gregsabo commented Jan 27, 2021

The template currently sets the API domain manually in config.js. Can this be done automatically with output variables?

Here's what I've tried so far:

In API's serverlesss.yaml:

app: myapp
org: foobar
component: express
name: api

inputs:
  src: ./

In the site's serverless.yaml:

app: myapp
org: foobar
component: website
name: app

inputs:
  src:
    src: ./
    hook: npm run build
    dist: build
    env:
      REACT_APP_API_ROOT: ${output:api.apiGatewayUrl}

But running serverless deploy in the app folder gives this error:

Serverless › Failed running "src.hook": "npm run build" due to the following error: Command failed: npm run build
env: node: No such file or directory

I'm guessing this error is because it can't resolve the output:api.apiGatewayUrl variable. Any ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant