Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
mongoose.model('vegetable').create(vegetables, function (error) {
if (error) throw error;
// Create the API routes
baucis.rest('vegetable');
// Create the app and listen for API requests
var app = express();
app.use('/api', baucis());
app.listen(3333);
console.log('Server listening on port 3333.');
});
});
Object.keys(models.models).forEach(function (key) {
var item = models.models[key];
var controller = baucis.rest(item.name, item.model).hints(true).comments(true);
item.controller = controller;
fixture.controllers.push(controller);
});
init: function (done) {
mongoose.connect(config.mongo.url);
fixture.controller = baucis.rest('vegetable').hints(true).comments(true);
fixture.controller.generateSwagger();
fixture.controller.swagger.lambic = 'kriek';
baucis.rest('fungus').select('-hyphenated-field-name -password');
baucis.rest('goose');
app = express();
app.use('/api', baucis());
app.use(function (error, request, response, next) {
if (error) return response.send(500, error.toString());
next();
});
server = app.listen(8012);
done();
},
deinit: function(done) {
init: function (done) {
mongoose.connect(config.mongo.url);
fixture.controller = baucis.rest('vegetable').hints(true).comments(true);
fixture.controller.generateSwagger();
fixture.controller.swagger.lambic = 'kriek';
baucis.rest('fungus').select('-hyphenated-field-name -password');
baucis.rest('goose');
app = express();
app.use('/api', baucis());
app.use(function (error, request, response, next) {
if (error) return response.send(500, error.toString());
next();
});
server = app.listen(8012);
done();
init: function (done) {
mongoose.connect(config.mongo.url);
fixture.controller = baucis.rest('vegetable').hints(true).comments(true);
fixture.controller.generateSwagger();
fixture.controller.swagger.lambic = 'kriek';
baucis.rest('fungus').select('-hyphenated-field-name -password');
baucis.rest('goose');
app = express();
app.use('/api', baucis());
app.use(function (error, request, response, next) {
if (error) return response.send(500, error.toString());
next();
});
server = app.listen(8012);
done();
},
deinit: function(done) {
Object.keys(models.models).forEach(function(key) {
var item = models.models[key];
if(item.hasController) {
var controller = baucis.rest(item.name, item.model);
item.controller = controller;
controllers.push(controller);
}
});