I took a very similar approach when I made my first Node API over a decade ago. In the end, it got complicated pretty quickly. I actually really like the Koa/Oak approach myself.
When you get to the point of even several dozen routes, I can imagine the registration methods in TFA to become overly cumbersome to say the least.
Just my own $.02 on this.
Worth noting, that adding a month the naive way won't always get you what you should expect... for example:
let dtm = new Date(2020,0,31); // Fri Jan 31 2020...
dtm.setMonth(dtm.getMonth() + 1);
console.log(dtm);
// Mon Mar 02 2020...
That's not what you should expect, I would expect the last day of February.
function addMonths(dtm, months = 1) {
const month = dtm.getMonth() + ~~months;
const ret = new Date(dtm); // clone date - don't mutate
ret.setMonth(month);
if (ret.getMonth() > month) {
ret.setDate(0); // go to end of previous month
}
return ret;
}
This way you can add to the date, without mutation and get the expected result.
let dtmIn = new Date(2020,0,31);
let dtmOut = addMonths(new Date(2020,0,31));
console.log(dtmOut);
// Sat Feb 29 2020...
Interesting... though unsure about potential pitfalls or costs in the future. I tend to be extra leery if I don't see clear pricing, including anything related to distribution costs/fees from something that isn't open source.
Not against commercial efforts at all, and this definitely seems cool, just need more on licensing costs and plans for monetization before I would look deeper.