0

I am working with backstage to deploy an application. I have app configuration file, app-config.yaml, that has a variable version that I want to pass onto a typescript file, Root.tsc.

app:
  title: Backstage Example App
  baseUrl: http://localhost:3000
  version:
     $env:VERSION_NUMBER
backend:
  listen: 0.0.0.0:7007
  baseUrl: http://localhost:7007
organization:
  name: CNCF
proxy:
  /my/api:
    target: https://example.com/api/
    changeOrigin: true
    pathRewrite:
      ^/proxy/my/api/: /

I have tried display the variable in my Root.tsc file

<div className={classes.upperversion}> {process.env.version} </div>

but realized the variable is not displaying because maybe I haven't included any file. How could I use the variable from my app-config.yaml file?

1 Answers1

0

Another alternative - not so suitable is to use Jinja. You create a template, and it is populated during the build process.

I even asked a similar question recently as per the link.