Avishaan Sethi

MongoDB SSH access on remote Meteor deployment

Access the MongoDB instance on your MUP (Meteor UP) deployment using a GUI explorer

There comes a time when you need to access the MongoDB database associated with your remote MUP (Meteor Up) deployment. According to their docs the only way you can do this is to SSH in and access it from there. That's fine (and technically accurate) except that leaves you only with a console interface via meteor mongo which isn't . . .

Read More

December 20, 2015

Mobile App PDF generation from HTML

Client side generation of PDF using jsPDF, HTML, DataURIs, and Cordova on iOS8+ and Android in MeteorJS

We want to be able to generate an PDF document from HTML without needing direct processing by the server such that it is presented to the client in the Cordova app with a done button. This allows the user to generate a pdf, view it, and then close it and return to the app. I'll take a MeteorJS specific approach but it's very . . .

Read More

December 04, 2015

Bluebird with Mongoose

Quick examples of using bluebird with mongoose in node. I just want to show you a couple common use cases to help you recognize how to use promises.

We are going to take common Mongoose use cases for finding and creating documents and going to use Bluebird (or more generally, any promise library that follows Promises/A+) to migrate from the typical callback method to promises.

There are many sites that show you simple examples of promises but sometimes you just:

  • . . .

Read More

November 07, 2015

Dokku ipaddress:port based access without VHOST

A common use case is to use Dokku without an actual domain. I address how to use a consistent external port with an ip address since the docs don't.

Dokku isn't clear how to host a server when you don't have a domain you want to use. If you don't enable their vhost by default then the external port of your app CHANGES EVERY DEPLOY. They only describe in detail their deploy. Here I show you how to use the http://ipaddress:port deploy in a consistent . . .

Read More

Posted in: nodejsdokku

Setember 15, 2015

MeteorJS Quick Deploy

Quickly deploy MeteorJS to your own provider or services like Digital Ocean.

In this example we will talk about a quick deploy technique for MeteorJS apps. I recommend using Digital Ocean for this deployment example but any Nix based server should work.


I assume you already have npm installed. If you don't go ahead and get npm installed from here: . . .

Read More

August 13, 2015

Learning Promises via a Story

Learn the basic idea of promises in Javascript by listening to this story.

What is this about?

Any language/concept/idea is easier to learn when you come up with a relatable real life situation or metaphor. Programming is no different. I'll use the next few minutes to build up a simple promise example that you can run and play with while telling a memorable and relatable story.
My purpose here is to . . .

Read More

Posted in: javascriptnodejs

March 08, 2015

File Upload Using Swagger 2.0 Spec

A little information on how to edit your swagger.json document (v2) so that you can accept file uploads in NodeJS. Includes a workaround for a current bug.

I have searched far and near for how to write your Swagger doc to allow a file upload. They are usually for the "1.2" spec but sometimes they are incorrect as well.

The following snippet will allow you to send a file which will be in req.body.files.file (when using multner)

 "/v1/images": {
  . . .

Read More

Posted in: swaggerjsnodejs

December 06, 2014