Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    ClementVidal
    @ClementVidal
    Is there a way in baucis to disable only a subset of requests available for a given HTTP verb ?
    For exemple, i want to disable DELETE on /MyResource and not on /MyResource/{id}
    Does controller.methods() provide a way to do that ?
    Thanks !
    Thank you !
    William P. Riley-Land
    @wprl
    @ClementVidal no, controller.methods doesn't let you do that (might be a good feature though). Best way currently would be something like: controller.request('collection', function (request, response, next) { if (request.method === 'DELETE') return response.send(RestError.Forbidden(); next() });
    Ricardo Macario
    @rickitan
    Hi @wprl ! I'm just checking out Baucis, it looks great. I've been looking for a similar solution. I'm wondering how can I do date range queries ?
    Pedro J. Molina
    @pjmolina
    Hi @rickitan Here you have a sample query for dates: wprl/baucis#213 Combining $and, gte, & lt can do the trick for you like in http://stackoverflow.com/questions/2943222/find-objects-between-two-dates-mongodb
    Appnow generates microservices and deploy on cloud. Take a look. Uses full baucis under the scenes. https://appnow.radarconline.com
    Needs Swagger 2.0 support? Take a look to: https://www.npmjs.com/package/baucis-swagger2
    Ricardo Macario
    @rickitan
    @pjmolina thank you very much pj
    Dan Quinn
    @danielpquinn
    Is there a reason that RestError.Unauthorized doesn't exist? I'm finding it impossible to make my status code 401, even when I set "handleErrors" to false in my controller config.
    It looks like baucis will change any error that isn't a RestError into an InternalServerError, which seems like an issue
    Dan Quinn
    @danielpquinn
    Maybe subclassing RestError is the way to go, now that I think about it. Thanks for the awesome library btw!
    William P. Riley-Land
    @wprl
    Thank you and glad you were able to solve your issue. Seems I don't have email notifications set up correctly…
    Aaron Ash
    @aaronash
    Hello all, this looks like an awesome project. I'm a complete newbie to node.js and javascript in general. I'd love to get baucis working with this project: https://github.com/sahat/hackathon-starter I added the vegetable example from the readme, with a route of app.use('/baucis', baucis());, but it's giving me a 404. I'm sure I'm missing something obvious, but I have no idea how to go about debugging. I tried logging all routes with console.log(app._router.stack) and I see the baucis route is route: undefined, where as the other routes are not undefined, but I'm not sure if that's the issue or not. Any tips would be greatly appreciated. Thanks!
    William P. Riley-Land
    @wprl
    Hi @Charybdis would it be possible to share your code? I can get a better idea of what might be going wrong that way.
    Aaron Ash
    @aaronash
    @wprl yes, if you checkout that project, everything is the same, but my app.js looks like this: https://ghostbin.com/paste/ce6t8 Meanwhile I started taking a look at just manually doing things with Mongoose, but I'm still interested in baucis. Thanks!
    William P. Riley-Land
    @wprl
    @Charybdis I couldn't reproduce the issue locally. If you decide to start using baucis again, I'd be happy to work on figuring out what is not working for you locally and getting you going.
    Aaron Ash
    @aaronash
    @wprl that would be great - I just tried again with a fresh checkout of that repo, same issue. I'm apparently on node v5.7.1, maybe that has something to do with it? I forgot exactly how I installed node, (I'm using OSX), but I'll try updating it.
    Aaron Ash
    @aaronash
    @wprl I was apparently using npm to manage node. I just updated to v6.3.1 and did an npm rebuild which seemed to update my packages for the newer version of node. Tried again, still getting a 404. What do you recommend I try next? If you know of any good documentation for debugging something like this, I'd be curious
    William P. Riley-Land
    @wprl
    @Charybdis Would you mind cding into node_modules/baucis, then run npm install, then npm test, and finally copy/pasting the output to a gist?
    William P. Riley-Land
    @wprl
    @Charybdis thanks! I will check it out this afternoon.
    William P. Riley-Land
    @wprl
    @Charybdis do you get an actual 404 or does the request just hang? I see in your code you are calling mongoose.connect but wanted to verify because if mongoose fails to connect, the request will hang.
    Aaron Ash
    @aaronash
    @wprl it returns Cannot GET /test/, the node console output shows me GET /test/ 404 18.131 ms - 18
    @wprl I setup my local port 3000 to be accessible through here: http://6e8fa8a2.ngrok.io/test/ (at least while I'm at this coworking space)
    Aaron Ash
    @aaronash
    sorry, just restarted it, here now: http://0205d338.ngrok.io/
    Aaron Ash
    @aaronash
    when mongoose fails to connect it prints out that error. I'm able to save other mongoose objects with no problem, it seems.
    William P. Riley-Land
    @wprl
    If i go to http://0205d338.ngrok.io/baucis/vegetables I get a partial response, but not a 404. Is this what you see?
    @Charybdis I ran this locally and can connect to localhost:3000/baucis/vegetables does it work for you? Should response with an empty JSON array as the response body.
    Aaron Ash
    @aaronash
    @wprl wow, yes, it works. I suppose I'm just an idiot. I was thinking it would show at just /baucis
    William P. Riley-Land
    @wprl
    ha no worries
    Aaron Ash
    @aaronash
    so it automatically adds the s at the end
    can I control what the plural form is?
    William P. Riley-Land
    @wprl
    Correct
    here's a link to the plural model method on the Wiki: https://github.com/wprl/baucis/wiki/Models#modelplural
    You use it like
    mongoose.model('fungus', Fungus).plural('fungi');
    Aaron Ash
    @aaronash
    awesome, now that I have this working I can experiment some more. I'll try to be a bit more attentive to those details, heh. Thanks for helping me with this. I'll read up on the docs.
    William P. Riley-Land
    @wprl
    Cool, glad we were able to get you going. Feel free to drop by with any other questions or concerns you come across.
    Aaron Ash
    @aaronash
    great, thanks a ton
    LuisHerasme
    @LuisHerasme
    can i use mongoose instead of a relational database
    ?
    William P. Riley-Land
    @wprl
    Yes, in fact you can only use Mongoose with Baucis 1.x. Support for additional data stores is planned for Baucis2.
    LuisHerasme
    @LuisHerasme
    Support for additional data stores ?
    William P. Riley-Land
    @wprl
    Currently, Mongoose is your only choice when using Baucis.
    Aaron Ash
    @aaronash
    @wprl is Baucis still maintained?
    whether or not it is, still experimenting with it again :) I'm trying to figure out how to do a PUT request to update a specific object with a certain variable. For example, I have a station object, and I'd like to update the title for the object with station_id == 12345
    Aaron Ash
    @aaronash
    I figured it out. What I ended up doing is something like controller.findBy('station_id'); and making sure station_id is unique.