Skip to content

Globegitter/vagrant-sailsjs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Vagrant Box for SailsJS

##Features Get up and running with SailsJS blazingly fast, so you only have to worry about what you're good at - developing. This box comes with:

  • Ubuntu 14.04
  • Nodejs v.0.10.x, Redis stable release, MongoDB 2.6.*, MySQL
  • Auto-reload of your server whenever you change a file using pm2.
  • Port-forwarding and all the other useful things you are used to from your Vagrant setup

##Setup

  • Clone the repository git clone https://github.com/Globegitter/vagrant-sailsjs.git.
  • Run vagrant up and enjoy a cup of tea until everything gets downoaded and installed.
  • SSH in with vagrant ssh.
  • cd ~/server/ and rm .gitignore.
  • Then run sails new . or sails new . --linker, if you are planning to use https://github.com/cashbit/sails-crudface.
  • Add a processes.json with { "ignoreWatch" : [".tmp", "views"] } in this folder, so pm2 only auto-reloads the Server when needed.
  • Run pm2 start app.js -x --watch (Note: you don't need the -x if you are running Node >= 0.11.x), this ensures that the server runs all the time and updates on any code change.
  • Run sails generate api user or whatever - Happy coding!
  • Shut down with vagrant halt.
  • Run node inspector via node-debug app.js --save-live-edit=true
  • In production just run env NODE_ENV='production' pm2 start app.js -x

##SailsJS MySQL Configuration

  • To get setup with mysql install npm install sails-mysql --save
  • Open config/connections.js you can use the following configuration:
  someMysqlServer: {
    adapter: 'sails-mysql',
    host: '127.0.0.1',
    user: 'root',
    password: '',
    database: 'database'
  }
  • Then open config/models.js update connection to connection: 'someMysqlServer'
  • You are all set, create your models and let SailsJS do the grunt-work for you.

##Access from your local machine

  • redis.cli h 192.168.33.10 -p 6379
  • mongo 192.168.33.10
  • MySQL mysql -h 127.0.0.1 -P 7778 -u root
  • SailsJS Server localhost:1337

##Requirements:

##Roadmap

  • Planning on automating a few of the steps in the future.
  • There may be some differences if the generators are run on the local machine or on the vm - forever doesn't seem to reload for generators run on local. Will investigate at some point.

List of all puppet manifests that will install: [Nodejs - v0.10.*, Redis - last stable release, MongoDB - 2.6.*, MySQL, SailsJS 0.10.x, pm2, node-inspector, wget, git, vim, htop, g++, fish]

About

Vagrant Box that sets up SailsJS with everything you could want.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 84.1%
  • Puppet 14.1%
  • PHP 1.7%
  • Shell 0.1%