Stream: beginners

Topic: how to change host/port of a basic-webserver application?


view this post on Zulip Lorentz Lasson (Dec 20 2023 at 18:22):

naively tried ROC_BASIC_WEBSERVER_PORT=3000 roc dev after finding these two lines in the basic-webserver repo, but i still get port 8000

view this post on Zulip Brendan Hansknecht (Dec 20 2023 at 18:24):

Roc probably doesn't forward env args to the subprocess?

view this post on Zulip Brendan Hansknecht (Dec 20 2023 at 18:24):

Does it work if you build and then add the env var to a call directly to the executable?

view this post on Zulip Lorentz Lasson (Dec 20 2023 at 18:26):

afraid not :/

$ roc build
    main
$ ROC_BASIC_WEBSERVER_PORT=3000 ./main
Listening on localhost port 8000

view this post on Zulip Anton (Dec 20 2023 at 18:30):

ROC_BASIC_WEBSERVER_PORT is a recent addition that is not released yet, are you using a release of the basic-webserver platform?

view this post on Zulip Lorentz Lasson (Dec 20 2023 at 18:32):

ah ok :+1: yes using release 0.1

view this post on Zulip Anton (Dec 20 2023 at 18:33):

You can download the source and use it from a local folder like this:

app "yourapp"
    packages { pf: "platform/main.roc" }

view this post on Zulip Lorentz Lasson (Dec 20 2023 at 18:39):

yes, fantastic! works like a charm :bow:


Last updated: Jul 06 2025 at 12:14 UTC