Naeem Shaikh
Naeem Shaikh

Reputation: 15715

Pushing custom node_module while deploying on heroku

I am trying to deploy my node-express website on heroku. Everything works fine, but just one problem.

I have used express-stormpath as a dependency in my project, which i have customized(the views only).

When I deploy this to heroku, using git push heroku master, the node_module is ignored while uploading and all the modules are installed by heroku itself using npm. So my customization to the node module is not reflected at heroku.

I have tried this also: npm install private github repositories by dependency in package.json

Any suggestions on how to upload whole project including the node_modules to heroku?

Upvotes: 2

Views: 1035

Answers (1)

rdegges
rdegges

Reputation: 33824

If you're using express-stormpath, you should not be customizing the views inside of node_modules -- this is the wrong way to do it. Instead you should be putting your custom views inside of your own 'views' folder, and telling express-stormpath where that file is.

Here's an example of a custom login view, for instance:

app.use(stormpath.init(app, {
  loginView: __dirname + '/views/login.jade',
  // ...
}));

If you take a look at the express-stormpath docs here: https://docs.stormpath.com/nodejs/express/product.html#update-template-paths (it shows you how to do this).

NOTE: I'm the author of express-stormpath and I randomly saw this question ^^ Hope this was helpful!

Upvotes: 2

Related Questions