-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
plugin API #7
Comments
Hi Rafał, Short answer: as a quick dirty hack you could accomplish that by declaring Zappa actually doesn't use globals anywhere. Your app's code is just dynamically compiled into a function where things like get, view, etc are made available as local variables before your code. Currently there isn't a way to add local variables to the app scope, the way we do to the request/message handler scope with |
+1 for a global "registry" ATM we use the def hack...
|
Not sure what you mean by a "global registry". What is it that you're trying to solve with that? |
sorry to bump an old issue, but I'm also struggling with where to require my db-handler and how to make it available consistently across views. if you could write a little example on how you'd use cradle / mongoose with zappa, that would be sweet! I'm currently doing a
ReferenceError: cradle is not defined |
So to use
If you had defined that as a
But if you don't need access to any HTTP handling stuff in |
Aah, that explains it. Thanks! I will finish reading Javascript: The Good |
Hi!
Is it possible to define global function like view in included coffeescript file?
example:
mongoose = require('mongoose').Mongoose
db = mongoose.connect 'mongodb://localhost/db'
The text was updated successfully, but these errors were encountered: