I have a greenfield full stack project coming up and I’m looking to build it in PureScript. However, I currently have no backend experience with PureScript. What are the current best options for backend?
Hi what do you mean with backend? Are you looking for ways to build the server/backend part with PureScript and are looking for packages/frameworks/bindings or purescript-backends (compiling to something different than JS/Node)?
Or are you looking for languages/frameworks that works nicely(?) with PureScript?
I’m looking for a backend web framework. Ideally one that is 100% PureScript and not just bindings to another library.
HTTPurple is a backend http server for Node.js written in Purescript. It´s originally a fork from @cprussin ’s amazing HTTPure but with a lot of new additions.
I ended up going with HTTPure, thanks for the tip
perhaps next time I will give HTTPurple a try.
I went to make a new full stack app today, and after copy-paste-trimming my old codebase, I have come to find out httpure is no longer in the package set and hasn’t been updated in 2 years. Just curious if anything else has popped up since a year ago, or if HTTPurple now stands alone.
I’ve just become interested in this too. There has been no update to HTTPurple in three years now. I’ve found that the CustomStack example doesn’t compile and it doesn’t seem possible to report errors.
It might be pretty easy to get it updated. I’ve been doing that throughout the ecosystem lately. I’ll give it a look tonight. Most modules only really need minimal updating.
Edit: The main part of the repo compiles fine but I can’t get the testing working with the newest spago version because of its unusual folder structure (and also because I’m a total newb).
I’ve made a little progress in converting to spago@next. I can compile everything if I rename docs/Examples
to docs/src
and place a small spago.yaml file in this new src
directory which defines its name. I then add a reference to this path in the workspace.
However, when I try to run the tests, spago complains about a naming conflict. I suspect that this is probably because the docs sources all contain a main method (these are used in the integration tests). I can resort to just building if the name of this docs resource differs between the two spago,yaml files.
Perhaps this can’t be resolved until we get full monorepo support in spago. I’m not sure.
If you are converting to a monorepo then no modules can have the same name — you’ll need to rename them from Test.Main to some unique name instead.
I’m confused by this - spago is complaining that some modules in the workspace clash with those in the tree but all the offending modules have distinct names prefaced with Examples
. For the life of me, I cant find a clash.
If you can link me to the code I’m happy to take a look
That’s really kind of you, @thomashoneyman. It’s at GitHub - newlandsvalley/purescript-httpurple: 🪁 A simple, type-safe http server for PureScript. The troublemaker is the docs/src
directory.
If where asked I would not recommend using HTTPurple to one who wants to build flexible and modular software. HTTPurple at best looks like very oppinionated custom all-in-one framework for running HTTP server.
It is quite easy to make your own basic wrapper (mini-framework) around Node.HTTP.*
modules that will do common staff for serving HTTP requests, if you need you may use Routing.Duplex
for safe routes, appropriate for the use case JSON/codescs libs, etc.
It has lots of stuff that is arguably not needed, some JsonDecoding logic, middleware, this all just complicates things. It has useful functionality for working with request/response data that you would otherwise need to implement somehow, but it is not modular, not composable.