Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Thoth from minimal template #424

Closed
isaacabraham opened this issue Feb 21, 2021 · 3 comments
Closed

Remove Thoth from minimal template #424

isaacabraham opened this issue Feb 21, 2021 · 3 comments

Comments

@isaacabraham
Copy link
Member

I think we should remove Thoth from the minimal template - or at least from the code sample (maybe just keep as a package reference?) - it's simply not required. We also no longer need the use the json combinator on the back end:

On the server

let webApp = router {
    get Route.hello (text "Hello from SAFE!")
}

On the client

...
let! response = Fetch.fetch Route.hello [] // Uses the built-in browser Fetch API that comes with Fable.
let! message = response.text()
header.innerText <- message
...
@isaacabraham
Copy link
Member Author

I was wrong. That Fetch method is supplied by the Thoth package. But we don't need to include the Thoth-specific members in the code. In other words, I think that the sample above should still be used - it only uses the raw fetch method which is standard in Browsers rather than the Thoth-specific extensions.

@theimowski
Copy link
Member

#415 doesn't contain Thoth on Server side anymore in minimal template. AFAIK for Fetch API inside fable you either need to use Thoth.Fetch or Fable.Fetch package. I'll see if I can make #415 use the latter one

@isaacabraham
Copy link
Member Author

Awesome. Could / should we use text rather than json (given that the message is actually just plain text)?

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

No branches or pull requests

2 participants