Skip to content

Proxy not working if Browser.application is usedΒ #601

@ad-si

Description

@ad-si

Is this a bug report?

Yes

Environment

  1. node -v: v16.10.0
  2. npm -v: 7.24.1
  3. npm ls create-elm-app -g:
    /usr/local/lib
    └── [email protected]

Then, specify:

  1. Operating system: macOS Catalina 10.15.7 19H1419 x86_64

Steps to Reproduce

  1. Start a JSON API server at http://localhost:8081 serving an /items endpoint
  2. Add this to elmapp.config.js
    module.exports = {
      proxy: "http://localhost:8081",
    }
  3. Create Elm app like:
    main : Program () Model Msg
    main =
        Browser.application
            { view = view
            , init = \_ -> \_ -> \_ -> init
            , update = update
            , subscriptions = always Sub.none
            , onUrlRequest = \_ -> NoOp
            , onUrlChange = \_ -> NoOp
            }
  4. Start elm app with npx elm-app start

Expected Behavior

http://localhost:3000/items should serve the JSON

Actual Behavior

Serves the same Elm app as under http://localhost:3000


I assume that the problem is the interaction with Browser.application, but I'm not sure about that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions