How to use the baucis.rest function in baucis

To help you get started, we’ve selected a few baucis examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github wprl / baucis-example / app.js View on Github external
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.');
  });
});
github pjmolina / event-backend / test / domain / fixtures / fakeserver.js View on Github external
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);
        });
github wprl / baucis-swagger / test / fixtures / vegetable.js View on Github external
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) {
github wprl / baucis-swagger / test / fixtures / vegetable.js View on Github external
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();
github wprl / baucis-swagger / test / fixtures / vegetable.js View on Github external
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) {
github pjmolina / event-backend / app / server.js View on Github external
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);
	}
});

baucis

Build scalable REST APIs using the open source tools and standards you already know.

MIT
Latest version published 3 days ago

Package Health Score

60 / 100
Full package analysis