Sails Quickstart

Quickstart

  1. Prerequisite: ensure local npm bin paths are in your search path (see KB: Adding npm bin/ path to command search path)
  2. Login to terminal
  3. Create a folder for your Sails application, in this example, we will use /var/www/sails:
    cd /var/www
    mkdir sails
    cd sails
  4. Install Sails from npm:
    npm install sails
  5. Create a new application called app
    sails new app
  6. Switch to the new directory, app/, and create a Passenger-compatible filesystem layout:
    cd app
    mkdir public tmp log
  7. Designate this as a Node application by adding the necessary htaccess directive to public/.htaccess:
    echo 'PassengerNodejs /usr/bin/node' > public/.htaccess
  8. Connect /var/www/sails/app/public to a subdomain or addon domain within the control panel

    • The subdomain sails.sandbox.hostineer.com is connected to the filesystem path /var/www/sails/app/public via Web > Subdomains
  9. Access Sails, done!

    Default welcome screen for a newly minted Sails application

    Default welcome screen for a newly minted Sails application

See also

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.