Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do i move a sails app to the host? #183

Closed
egucciar opened this issue Feb 28, 2013 · 4 comments
Closed

How do i move a sails app to the host? #183

egucciar opened this issue Feb 28, 2013 · 4 comments

Comments

@egucciar
Copy link

Im completely new to node.js wondering how i can get my app on a host (appFrog)

@mikermcneil
Copy link
Member

Hi Erica,

You'll want to take advantage of a tool that 'resurrects' your server if it crashes. @techpines is working on bundling forever so you can run Sails as a daemon with sails lift -d in the next release.

In the mean time, here's how you deploy in production mode:

  • In your project folder, create a file called app.js:
// app.js
require('sails').lift();
  • Install forever: sudo npm install -g forever
  • Run your app with forever: forever start app.js

More about forever: https://github.com/nodejitsu/forever

Other things you'll likely want to do in production:

  • configure your app to run on port 80
  • put it in "production" mode so that all of your css/js gets bundled up
  • use mySQL

More on that here:

http://www.youtube.com/watch?v=GK-tFvpIR7c

The big omission from that video is that, if you plan on keeping your app running (which you probably do!), you'll need to follow the steps mentioned above to use forever.

Getting your app on the server

Is your Node.js instance on appFrog spun up? When you have the ip address, you can go ahead and ssh onto it, then sudo npm install -g sails forever to install Sails and forever for the first time.

Then git clone your project (or scp it onto the server if it's not in a git repo) into a new folder on the server and cd into it, and forever start app.js

Hope that helps!

@mikermcneil
Copy link
Member

@dcbartlett Would you be down to turn this into a how-to wiki page?

@mikermcneil
Copy link
Member

@eguciar Hey Erica, I hope that got you sorted. Please feel free to reach out in the IRC or google group if you need more help! I'm going to close this issue. I also posted the resolution here:

https://github.com/balderdashy/sails/wiki/Guide:-Deployment

@AnvarPK
Copy link

AnvarPK commented Dec 4, 2015

can i clone sail project to ftp server

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants