All posts tagged in node.js

  • MongoDB, Node.js and admin auth

    July 20, 2011

    There is a big challenge to make MongoDB driver to work with Node.js, but here is an cool and working example to do that: Require: var mongodb = require("mongodb"); //require node-mongodb-native var settings = require('./mconfig'); //for settings Connect to the admin database: var mongoserver = new mongodb.Server(settings.mongo_host, settings.mongo_port, {}); admindb = new mongodb.Db('admin', mongoserver); Try

  • Full HTTPS REST server in Node.js

    July 20, 2011

    I will show you now, how to write a simple HTTPS JSON REST server using node.js components. Grab a beer, open your IDE and let’s start hacking. 0. Create certificates. If you don’t have valid https certificates, you can generate one for testing purposes. If you need one cool certificate, you can join cacert community.