#Issue posting data with Fable.Remoting (SAFE Stack)

1 messages · Page 1 of 1 (latest)

knotty sail
#

Hey gang!

This is my first post here! I work full time in C#, and have decided to pick up F# and the SAFE stack for a fun little toy project. This is my first go at F# / web dev with F#, and it's a ton of fun haha.

Things have been going really well, but I have encountered a road block while using Fable.Remoting. For some reason, I cannot seem to post data to my server. I am able to configure and use GET endpoints, and have been able to post data using the methods within the SAFE template, but I am at a loss as to why I can't use my new homemade POST method.

I have verified via the browser's network tab that the payload is populated with the correct data, and that the createUser endpoint is the destination, but I am getting a 500 error everytime I attempt to hit the createUser endpoint. In debugging, I've found that the code is never even hit - really confused as to why this is going down, and thought I should reach out to the friendly folks over here haha.

For reference:

I tried to set it up exactly like the SAFE template, but it's not working - I must be missing something obvious here haha. Very new to this tech stack, help would be much appreciated : )

somber remnant
#

Looks to me like Fable.Remoting is set up correctly. 500 generally points to an exception, I think your repository class might throw on CreateUser.

#

I would suggest to run the server not via your build project's run command but instead in debug mode in VS or Rider or whatever IDE you use, and set a few breakpoints.