Skip to content

Conversation

@rasheedmhd
Copy link
Contributor

An example for creating Elm applications that uses the roc basic-webserver

@Anton-4
Copy link
Collaborator

Anton-4 commented Aug 12, 2024

Ah, yes, the CI problem is the same as in #191, this will be fixed with #192.

 spawn ./examples/Arithmetic/main 20 4

Error: output was different from expected value.

Copy link
Collaborator

@lukewilliamboswell lukewilliamboswell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @rasheedmhd -- this will be a useful example for people looking to build a backend for Elm apps. 😄 I've left some comments for you.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like this example should include more routes, or interesting things to integrate/work with Elm.

Some ideas ... we could have the webserver include a JSON endpoint or two? Maybe an example authentication flow? Maybe do some CRUD on a sqlite database?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's good to have a minimal example, we can add a more complex one later.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree we can add another more complex example later, but I do think we should consider more for the roc side here. My concern is that the current implementation may also confuse someone who isn't familiar with roc because the routing and servers-side parts are left out.

We can keep the elm minimal, because the reader is likely familiar with Elm, and add a little to the roc web-server -- maybe demo using roc-json or something.

I can contribute some ideas if that helps.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, good idea, roc-json is indeed what you would use, even for a simple webapp.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've made issue #198 for this

@Anton-4 Anton-4 self-assigned this Aug 13, 2024
@Anton-4
Copy link
Collaborator

Anton-4 commented Aug 13, 2024

I apologize for not making this clear, but I'm nearly finished with my review and changes. Please hold off on making changes until my commit is in.

Edit: Done

@Anton-4 Anton-4 removed their assignment Aug 13, 2024
Copy link
Collaborator

@Anton-4 Anton-4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @rasheedmhd!

@Anton-4 Anton-4 merged commit 151c148 into roc-lang:main Aug 26, 2024
@rasheedmhd
Copy link
Contributor Author

You're welcome and THANKS too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants