codecombat/server/commons/mapping.coffee

76 lines
2.8 KiB
CoffeeScript
Raw Normal View History

module.exports.handlers =
'analytics_log_event': 'analytics/analytics_log_event_handler'
'analytics_perday': 'analytics/analytics_perday_handler'
'analytics_string': 'analytics/analytics_string_handler'
'analytics_stripe_invoice': 'analytics/analytics_stripe_invoice_handler'
# TODO: Disabling this until we know why our app servers CPU grows out of control.
2014-12-17 17:17:50 -05:00
# 'analytics_users_active': 'analytics/analytics_users_active_handler'
'article': 'articles/article_handler'
'campaign': 'campaigns/campaign_handler'
'clan': 'clans/clan_handler'
'classroom': 'classrooms/classroom_handler'
2015-08-29 10:15:35 -04:00
'course': 'courses/course_handler'
'course_instance': 'courses/course_instance_handler'
'level': 'levels/level_handler'
'level_component': 'levels/components/level_component_handler'
'level_feedback': 'levels/feedbacks/level_feedback_handler'
'level_session': 'levels/sessions/level_session_handler'
'level_system': 'levels/systems/level_system_handler'
'patch': 'patches/patch_handler'
'payment': 'payments/payment_handler'
'purchase': 'purchases/purchase_handler'
'thang_type': 'levels/thangs/thang_type_handler'
'user': 'users/user_handler'
2014-08-14 14:55:43 -04:00
'user_code_problem': 'user_code_problems/user_code_problem_handler'
2014-06-17 16:03:08 -04:00
'user_remark': 'users/remarks/user_remark_handler'
'mail_sent': 'mail/sent/mail_sent_handler'
'achievement': 'achievements/achievement_handler'
'earned_achievement': 'achievements/earned_achievement_handler'
2015-03-07 19:30:25 -05:00
'poll': 'polls/poll_handler'
'prepaid': 'prepaids/prepaid_handler'
'subscription': 'payments/subscription_handler'
'trial_request': 'trial_requests/trial_request_handler'
'user_polls_record': 'polls/user_polls_record_handler'
module.exports.handlerUrlOverrides =
'analytics_log_event': 'analytics_log_event'
2015-11-13 14:11:07 -05:00
'analytics_perday': 'analytics_perday'
'analytics_string': 'analytics.string'
'analytics_stripe_invoice': 'analytics.stripe.invoice'
'level_component': 'level.component'
'level_feedback': 'level.feedback'
'level_session': 'level.session'
'level_system': 'level.system'
'thang_type': 'thang.type'
'thang_component': 'thang.component'
'user_code_problem': 'user.code.problem'
'user_remark': 'user.remark'
'mail_sent': 'mail.sent'
'user_polls_record': 'user.polls.record'
module.exports.routes =
[
'routes/admin'
'routes/auth'
'routes/contact'
'routes/db'
'routes/file'
'routes/folder'
2014-08-15 10:20:45 -04:00
'routes/github'
'routes/languages'
'routes/mail'
'routes/sprites'
2014-02-06 16:25:11 -05:00
'routes/queue'
'routes/stacklead'
2014-12-02 23:01:35 -05:00
'routes/stripe'
2014-02-05 18:13:42 -05:00
]
mongoose = require 'mongoose'
module.exports.modules = modules = # by collection name
'achievements': 'Achievement'
'level.sessions': 'level.session'
'users': 'User'
mongoose.modelNameByCollection = (collection) ->
mongoose.model modules[collection] if collection of modules