# app.get "/example", example.index
# require("./routes/index") app
I know my first line goes to my controller called example and uses the index function. I'm not really sure what the second line does. Is one better than the other? A full explanation would be appreciated.
The first line: app.get "/example", example.index says that if someone hits the URL http://localhost:3000/example, then you are loading the example file (presumably required somewhere above) and running the index function on it.
The second line require("./routes/index") app is simply requireing some file called index.coffee in the routes folder and passing app as a variable.