Open ad-si opened 2 years ago
Yes
node -v
npm -v
npm ls create-elm-app -g
Then, specify:
/items
elmapp.config.js
module.exports = { proxy: "http://localhost:8081", }
main : Program () Model Msg main = Browser.application { view = view , init = \_ -> \_ -> \_ -> init , update = update , subscriptions = always Sub.none , onUrlRequest = \_ -> NoOp , onUrlChange = \_ -> NoOp }
npx elm-app start
http://localhost:3000/items should serve the JSON
http://localhost:3000/items
Serves the same Elm app as under http://localhost:3000
http://localhost:3000
I assume that the problem is the interaction with Browser.application, but I'm not sure about that.
Browser.application
So the proxy is actually working, but you can't open it in the browser! 😅 Because of the requested Content-Type I guess?
Content-Type
I leave this issue open as "Improve documentation on how proxy is working exactly"
Is this a bug report?
Yes
Environment
node -v
: v16.10.0npm -v
: 7.24.1npm ls create-elm-app -g
: /usr/local/lib └── create-elm-app@5.22.0Then, specify:
Steps to Reproduce
/items
endpointelmapp.config.js
npx elm-app start
Expected Behavior
http://localhost:3000/items
should serve the JSONActual 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.