basic-webserver
basic-webserver copied to clipboard
A basic webserver in Roc
# code ```roc app [Model, server] { pf: platform "https://github.com/roc-lang/basic-webserver/releases/download/0.9.0/taU2jQuBf-wB8EJb0hAkrYLYOGacUU5Y9reiHG45IY4.tar.br" } import pf.Stdout import pf.Http exposing [Request, Response] import pf.Url Model : {} server = { init: Task.ok {}, respond...
Based on builtin-task so most of these commits should merge (hopefully) and disappear.
As discussed on [zulip](https://roc.zulipchat.com/#narrow/stream/231634-beginners/topic/secret.20management), there should be some kind of support for reading environment variables via dotenv files. I think there are two possibilities here. 1. Have a `.env` file...
[zulip discussion](https://roc.zulipchat.com/#narrow/stream/383402-API-Design/topic/Default.20error.20handling.20in.20basic-webserver/near/436375969) Logging here so we don't lose track of this thread
See: - https://github.com/roc-lang/basic-webserver?tab=readme-ov-file#example - https://github.com/roc-lang/basic-webserver/blob/main/.github/workflows/ci.yml The example should be extracted from the README and put into a roc file for the test.
``` ❯ ./roc build ~/gitrepos/basic-webserver/examples/todos.roc 🔨 Rebuilding platform... An internal compiler expectation was broken. This is definitely a compiler bug. Please file an issue here: https://github.com/roc-lang/roc/issues/new/choose thread 'main' panicked at...
Some reason, we use I128 for each of the values in this struct: https://github.com/roc-lang/basic-webserver/blob/d592b4ec6d09352593465d17cdcc82fb2070ea6b/platform/InternalDateTime.roc#L9 This feels exceptionally large for no reason. We should analyze what is required and minimize the...
Url.roc for example contains a lot of shared code with [Url.roc in basic-cli/platform](https://github.com/roc-lang/basic-cli/blob/main/platform/Url.roc). All shared code should be put in (probably multiple) Roc packages so that improvements don't need to...
Currently we do a lot of allocating when going from rust to roc. I think we can avoid all of this on both sides. I don't fully understand all of...
When I run this (with latest source or 0.1 release) ```elm app "repro" packages { # pf: "../basic-webserver/platform/main.roc", pf: "https://github.com/roc-lang/basic-webserver/releases/download/0.1/dCL3KsovvV-8A5D_W_0X_abynkcRcoAngsgF0xtvQsk.tar.br", } imports [ pf.Task.{ Task }, pf.Stdout, # Unused but...