Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Created by student on 30.09.2014.
- */
- var coursesRoutes = require('../routes/courses')
- , db = require('../models');
- module.exports.name = 'courses';
- module.exports.require = ['users'];
- module.exports.init = function(app, modules, events) {
- // dev configuration
- if (app.get('env') === 'development') {
- db.Course.destroy({}, {truncate: true}).success(function(err) {
- db.Course.create({
- name: "First course",
- beginAt: new Date('21 May 2011'),
- endAt: new Date('21 May 2012')
- });
- db.Course.create({
- name: "Second course",
- beginAt: new Date('21 May 2010'),
- endAt: new Date('21 May 2011')
- });
- });
- }
- app.use('/courses', coursesRoutes);
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement