Deploying a Sails.js app to Heroku?

12,353

Solution 1

You should check out this github repo : heroku-sails It should get you started with sailsjs on heroku

There is a discussion around this particular github repo here on the sails.js google group

These are also resources that can help you get your app running :

Solution 2

I want to prevent any confusion for those who are familiar to node deployment on heroku. There are a lot of guides to deploying node apps to heroku and a sails app is really no different. If you start a sails app by typing "node app.js" in terminal it will work. Here is the guide put out by Heroku for node apps. The only thing different is that you have a sails rather than a plain vanilla express app.

https://devcenter.heroku.com/articles/getting-started-with-nodejs

I've used this to deploy my sails apps no problem.

Solution 3

First of all create sails js Website or project then change setting in sails js project as below:

in project config->env->production

   //remove from comments

  onlyAllowOrigins: [

  'https://example.com',

  'https://staging.example.com',

],

   //remove from comments

    trustProxy: true,

then deploy on heroku

Share:
12,353

Related videos on Youtube

Evan Hahn
Author by

Evan Hahn

I am a software developer who lives in a haunted mansion

Updated on February 04, 2020

Comments

  • Evan Hahn
    Evan Hahn over 4 years

    I have limited experience deploying Node.js apps -- how can I deploy a Sails.js app to Heroku?

    I've heroku logined and heroku created my app already.

  • mikermcneil
    mikermcneil about 10 years
    this is a great point- most things that apply to Express/Node also apply to Sails. Pretty much all the things.
  • noderman
    noderman over 9 years
    What about websockets? Do they work without problems?
  • wuliwong
    wuliwong over 9 years
    I'm very new to node and sails but if I understand correctly, as long as you have sails declared correctly in your dependencies (package.json) then heroku will install sails via npm?