Tag: heroku

gcloud pubsub – how to create watch request

I’ve created a topic, subscribed to it, set publishing rights of the topic using Google’s API Explorer and now need to create a watch request, as described here: https://developers.google.com/gmail/api/guides/push However, according to previous threads, you cannot do this with API Explorer and must do it directly from gcloud. I know the general form of the […]

Node.js + Mongoose works locally, but not on Heroku

Here’s my node.js file I’m running on Heroku. It works perfectly locally, but when I push it to Heroku, the database collection isn’t created and no errors are thrown. Ultimately I’m just trying to get it to actually creating the connection while it’s running on Heroku. Thanks. var mongoose = require(‘mongoose’), db_url = process.env.MONGOHQ_URL || […]

How to copy RedisToGo database in Heroku to local machine?

I have a node.js app, using RedisToGo and running in Heroku. I would like to copy the Redis To Go database to localhost for testing. When developing Ruby on Rails app, I can use heroku db:pull command. Is there any similiar command which I can use for node.js and Redis? Thanks.

heroku — npm postinstall script to run grunt task depending on enviro

I’ve got two heroku node.js apps, one for prod and one for dev, and I also have a Gruntfile with dev- and prod-specific tasks. I know you can set up package.json to run grunt as a postinstall hook for npm, but can you specify somehow different tasks to be run depending on what enviro you’re […]

Is it possible to consume environment variables inside of npm / package.json?

I’m attempting to build a package.json so that when running a NodeJS app on Heroku it will run the scripts.postinstall step using an environment variable. For example: … “scripts”: { “postinstall”: “command $ENV_VAR”} }, … I’ve looked at the docs and wasn’t able to find something saying I can. Is this even possible? Is this […]

Heroku ENOENT: no such file or directory, stat '/app/build/index.html'

I’m having trouble running a simple test site in Heroku. For some reason it’s trying to serve the content from /app/build/ when I want it to serve from /build/. Error: ENOENT: no such file or directory, stat ‘/app/build/index.html’ I read here not to use __dirname in the express app as Heroku set it to /app […]

Node.js: Is it possible to catch a “TypeError” and keep the server up?

Somtimes I have a typerror in my code that crashes my server. I’m wondering if there’s something I can add so it does not crashes after that happens. Here’s more details to the crash: 2011-06-08T11:23:09+00:00 app[worker.1]: /app/lib/imap.js:1019 2011-06-08T11:23:09+00:00 app[worker.1]: type: cur[0].toLowerCase(), subtype: cur[1].toLowerCase(), 2011-06-08T11:23:09+00:00 app[worker.1]: ^ 2011-06-08T11:23:09+00:00 app[worker.1]: TypeError: Object FILENAME,Oportunidad especial de has no […]

Meteor requires Node v0.10.41 or later Error on heroku deployment

I recently tried deploying my first MeteorJS (1.3) application on heroku and am getting a server log error – “Meteor requires Node v0.10.41 or later”. Not sure what the relationship is between node and meteor. Do meteor apps actually need a node backend or is this a meteor bug? Also, when I run “meteor node […]

Connecting to AWS Elasticsearch from non-AWS node.js app

I’m working on puzzling out an infrastructure-ish issue with a project I’m working on. The service that I’m developing is hosted on a transient, containerized platform w/o a stable IP — only a domain name (api.example.com). I’m utilizing Elasticsearch for search, so requests go to something like /my-search-resource and then use ES to find results to […]

Heroku says : Cannot find module 'socket.io'

I’m deploying an node.js app with deps/modules like : stylus, express, socket.io on heroku. The beginning of the server.js /** * Bootstrap app. */ // I’ve tried with and without that line… not sure what it does require.paths.unshift(__dirname + ‘/../../lib/’); /** * Module dependencies. */ // I’ve tried with “socket.io”, “./socket.io” and “Socket.IO” var express […]

Node.js is the Best Javascript runtime in the world.