Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

use server on localhost for forge development

Sascha Heinemann July 18, 2022

We're developing a business app with forge for some time now and have hosted a dev-backend to be able to test functionality before we ship the app to production.

As our team is growing now and we need to work on backend and frontend (forge) simultaneously, the approach with hosting a dedicated dev-instance is no longer feasible.

I was under the impression that, as long as I used forge tunnel, I could also use forge's fetch with a "backend" that ran on a local port (consider our backend runs on port 8080 within a local docker container).
Yet I was not able to get this to work and would always end up receiving ERROR [...] Address not allowed if I tried to use localhost.

 

This is the excerpt of my manifest.yml (foo being a placeholder obviously)

modules:
  jira:globalPage:
    - key: foo
      resource: main
      resolver:
        function: resolver
      title: foo
  function:
      - key: resolver
        handler: index.handler
resources:
  - key: main
    path: static/foo/dist
    tunnel:
      port: 3000
permissions:
  content:
    styles:
      - "unsafe-inline"
  external:
    fetch:
      client:
        - "*.localhost"
        - "*"
      backend:
        - "*.localhost"
        - "*"

I assumed it had something to do with permissions and tinkered a bit with fetch client and fetch backend permissions (e.g. using ip instead of localhost) but nothing worked.

 

Is this even possible and if so, what would be the best approach to connect to localhost?

Any help is appreciated.

1 answer

1 accepted

1 vote
Answer accepted
marc -Collabello--Phase Locked-
Community Champion
July 18, 2022

Hi @Sascha Heinemann ,

There are a couple of issues with your approach.

The first is: `*.localhost` is not a valid domain name.  On your computer, you can resolve `localhost`, but not `something-before.localhost`.

 

The second issue is that Forge can't resolve your localhost, because it needs a full domain name (like app.example.com).

If you have a server, you can reverse proxy through e.g. a SSH tunnel to local dev machines.

Sascha Heinemann July 18, 2022

HI @marc -Collabello--Phase Locked- 

thanks for your quick reply!

We'll give the reverse proxy a shot

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events