Live data from Hacker News

Show HN: Frodo – Rails like app generator for Node.js/Express

github.com

1–10 of 12 posts

Re: Show HN: Frodo – Rails like app generator for Node.js/Express

#3
post #2

Looking at the last example, how does it know that `name` is of type String and `age` is of type Number? Should it not be $ frodo generate model user name:string age:number or something?

In Rails, attributes without an explicit type are `String` by default. Not sure how age became a `Number`, though.

Re: Show HN: Frodo – Rails like app generator for Node.js/Express

#4
post #3
post #2

Looking at the last example, how does it know that `name` is of type String and `age` is of type Number? Should it not be $ frodo generate model user name:string age:number or something?

In Rails, attributes without an explicit type are `String` by default. Not sure how age became a `Number`, though.

I think "Number" is from Mongoose, which is an ODM for MongoDB.

Re: Show HN: Frodo – Rails like app generator for Node.js/Express

#5
Why does it have an IFFE on the controllers? This isn't a browser environment where we have to worry about files cluttering a global namespace. Each file is its own module where it has its own namespace. (Also this isn't needed for client-side development anymore unless you aren't using a build tool.)

Re: Show HN: Frodo – Rails like app generator for Node.js/Express

#6
post #5

Why does it have an IFFE on the controllers? This isn't a browser environment where we have to worry about files cluttering a global namespace. Each file is its own module where it has its own namespace. (Also this isn't needed for client-side development anymore unless you aren't using a build tool.)

I'm not a JS expert. Can you suggest the better way? I know that controllers are sandboxed, but I still like to add some 'namespacing'

Re: Show HN: Frodo – Rails like app generator for Node.js/Express

#7
post #2

Looking at the last example, how does it know that `name` is of type String and `age` is of type Number? Should it not be $ frodo generate model user name:string age:number or something?

Ooops.... Thank you. Of course, it should be so.
Post reply on HN