passing off hacker news clone to Nathan and his pair

This commit is contained in:
Michael Q Larson
2015-03-03 01:41:32 -08:00
parent 9a143ef435
commit b7a95ee56f
8 changed files with 157 additions and 38 deletions

View File

@@ -1,17 +1,20 @@
require('dotenv').load();
var Challenge = require('../models/Challenge.js'),
Bonfire = require('../models/Bonfire.js'),
Comment = require('../models/Comment.js'),
Story = require('../models/Story.js'),
Courseware = require('../models/Courseware.js'),
mongoose = require('mongoose'),
secrets = require('../config/secrets'),
challenges = require('./challenges.json'),
coursewares = require('./coursewares.json'),
stories = require('./stories.json'),
bonfires = require('./bonfires.json');
mongoose.connect(secrets.db);
var counter = 0;
var offerings = 3;
var offerings = 4;
var CompletionMonitor = function() {
counter++;
@@ -73,4 +76,21 @@ Courseware.remove({}, function(err, data) {
CompletionMonitor();
});
console.log('coursewares');
});
Story.remove({}, function(err, data) {
if (err) {
console.error(err);
} else {
console.log('Deleted ', data);
}
Story.create(coursewares, function(err, data) {
if (err) {
console.log(err);
} else {
console.log('Saved ', data);
}
CompletionMonitor();
});
console.log('stories');
});