Apologies if this should be clear or was previousl...
# box-products
j
Apologies if this should be clear or was previously asked - I am not quite clear as to what the difference is between the ColdBox rest vs the ColdBox rest-hmvc apps (https://coldbox.ortusbooks.com/getting-started/installation)? Or rather, which one I should start using, if my "goal" is to be able to offer an API so external apps can access certain database table contents in my website? I have previously used the Mura CMS API/ORM (a tiny amount only) but would like to keep the data separate from Mura/Masa CMS in this case as I generally want to build any new apps with ColdBox and become more, ahem, modern. (btw very likely looking into Data-Boss from Ortus as well, but I only discovered that tonight🙃). Cheers in advance for answers to my total beginner questions 🍺
b
@Jonas Eriksson The main difference is the rest template just has a handler baked into the app that does rest responses. The hmvc (or hierarchical mvc) uses nested modules to contain the rest handlers for a more complex but robust organization
They're both "correct" approaches. The first one is just simpler to understand and not as scary.
The second one (hmvc) is now we organize all our rest APIs
All the nesting of modules can seem unnecessary when just making a hello-world, but comes in rather handy when actually building a more complete app with multi-version rest APIs
Databoss is technically retired, but you can probably talk to Luis about getting the code for it. It works fine, it just had very few users and wasn't worth the upkeep as a commercial module
j
Thanks Brad for quick and thorough replies (as always)! Going to try both next week!
w
@Jonas Eriksson I would go for the REST-HMVC approach. It is better organized and not so scary at all 🙂 . If you have no intention at all to use multiple versions you could use the simple version, but if you only THINK you might ever change parts of the API, you better use the multi-version REST-HMVC approach to keep your users happy. If Brad is still asleep in these long European mornings, feel free to ping me if you have any questions. Once you know how to handle these templates, it is pretty simple.
👍 2