Skip to content

Instantly share code, notes, and snippets.

@negamorgan
Created May 28, 2015 15:22
Show Gist options
  • Select an option

  • Save negamorgan/00c3c7a6f1e6b3571e6c to your computer and use it in GitHub Desktop.

Select an option

Save negamorgan/00c3c7a6f1e6b3571e6c to your computer and use it in GitHub Desktop.

Revisions

  1. negamorgan created this gist May 28, 2015.
    21 changes: 21 additions & 0 deletions basic-sails-cms.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    npm install -g sails
    sails new someAppName && cd someAppName
    npm install --save sails-hook-adminpanel jade sails-mysql # or sails-mongo or sails-postgresql
    touch config/adminpanel.js # TODO draw the rest of the owl here...
    # in config/views.js, set 'engine' to 'jade'

    mysql -uroot # only if you need a new mysql user
    CREATE USER 'testuser'@'localhost'; # only if you need a new mysql user
    GRANT ALL PRIVILEGES ON * . * TO 'testuser'@'localhost'; # only if you need a new mysql user
    exit; # only if you need a new mysql user
    mysql -u testuser
    CREATE DATABASE testdb;
    exit;
    mysql -u testuser testdb < /dump/file.sql # only if you want to import an existing mysql database
    # in config/connections.js, add mysql db info
    # in config/models.js, uncomment 'connection' and add connection name from previous step
    # also uncomment 'migrate' and set to 'alter'

    sails generate model kitten name:string
    sails generate controller kitten index create show edit delete
    open localhost:1337/admin/kitten