├── .editorconfig
├── .eslintrc
├── .github
├── ISSUE_TEMPLATE
└── PULL_REQUEST_TEMPLATE
├── .gitignore
├── .npmignore
├── .travis.yml
├── CHANGELOG.md
├── CODE-OF-CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE.md
├── MODULES.md
├── README.md
├── ROADMAP.md
├── accessible
├── generate.js
└── rc.js
├── appveyor.yml
├── bin
├── private
│ ├── patched-commander.js
│ └── read-repl-history-and-start-transcribing.js
├── sails-console.js
├── sails-debug-console.js
├── sails-debug.js
├── sails-deploy.js
├── sails-generate.js
├── sails-inspect.js
├── sails-lift.js
├── sails-migrate.js
├── sails-new.js
├── sails-run.js
├── sails-upgrade.js
├── sails-www.js
└── sails.js
├── docs
├── PAGE_NEEDED.md
├── README.md
├── anatomy
│ ├── .editorconfig.md
│ ├── .eslintignore.md
│ ├── .eslintrc.md
│ ├── .htmlhintrc.md
│ ├── Gruntfile.js.md
│ ├── README.md
│ ├── README.md.md
│ ├── anatomy.md
│ ├── api
│ │ ├── api.md
│ │ ├── controllers
│ │ │ ├── controllers.md
│ │ │ └── gitkeep.md
│ │ ├── helpers
│ │ │ ├── .gitkeep.md
│ │ │ └── helpers.md
│ │ ├── models
│ │ │ ├── .gitkeep.md
│ │ │ └── models.md
│ │ └── policies
│ │ │ ├── .gitkeep.md
│ │ │ └── policies.md
│ ├── app.js.md
│ ├── assets
│ │ ├── .eslintrc.md
│ │ ├── assets.md
│ │ ├── dependencies
│ │ │ ├── dependencies.md
│ │ │ └── sails.io.js.md
│ │ ├── favicon.ico.md
│ │ ├── images
│ │ │ ├── gitkeep.md
│ │ │ └── images.md
│ │ ├── js
│ │ │ ├── gitkeep.md
│ │ │ └── js.md
│ │ ├── styles
│ │ │ ├── importer.less.md
│ │ │ └── styles.md
│ │ └── templates
│ │ │ ├── gitkeep.md
│ │ │ └── templates.md
│ ├── config
│ │ ├── blueprints.js.md
│ │ ├── bootstrap.js.md
│ │ ├── config.md
│ │ ├── custom.js.md
│ │ ├── datastores.js.md
│ │ ├── env
│ │ │ ├── env.md
│ │ │ └── production.js.md
│ │ ├── globals.js.md
│ │ ├── http.js.md
│ │ ├── i18n.js.md
│ │ ├── local.js.md
│ │ ├── locales
│ │ │ ├── de.json.md
│ │ │ ├── en.json.md
│ │ │ ├── es.json.md
│ │ │ ├── fr.json.md
│ │ │ └── locales.md
│ │ ├── log.js.md
│ │ ├── models.js.md
│ │ ├── policies.js.md
│ │ ├── routes.js.md
│ │ ├── security.js.md
│ │ ├── session.js.md
│ │ ├── sockets.js.md
│ │ └── views.js.md
│ ├── gitignore.md
│ ├── package.json.md
│ ├── sailsrc.md
│ ├── tasks
│ │ ├── config
│ │ │ ├── babel.js.md
│ │ │ ├── clean.js.md
│ │ │ ├── coffee.js.md
│ │ │ ├── concat.js.md
│ │ │ ├── config.md
│ │ │ ├── copy.js.md
│ │ │ ├── cssmin.js.md
│ │ │ ├── hash.js.md
│ │ │ ├── jst.js.md
│ │ │ ├── less.js.md
│ │ │ ├── sails-linker.js.md
│ │ │ ├── sync.js.md
│ │ │ ├── uglify.js.md
│ │ │ └── watch.js.md
│ │ ├── pipeline.js.md
│ │ ├── register
│ │ │ ├── build.js.md
│ │ │ ├── buildProd.js.md
│ │ │ ├── compileAssets.js.md
│ │ │ ├── default.js.md
│ │ │ ├── linkAssets.js.md
│ │ │ ├── linkAssetsBuild.js.md
│ │ │ ├── linkAssetsBuildProd.js.md
│ │ │ ├── polyfill.js.md
│ │ │ ├── prod.js.md
│ │ │ ├── register.md
│ │ │ └── syncAssets.js.md
│ │ └── tasks.md
│ └── views
│ │ ├── .eslintrc.md
│ │ ├── 404.ejs.md
│ │ ├── 500.ejs.md
│ │ ├── layouts
│ │ ├── layout.ejs.md
│ │ └── layouts.md
│ │ ├── pages
│ │ ├── homepage.ejs.md
│ │ └── pages.md
│ │ └── views.md
├── concepts
│ ├── ActionsAndControllers
│ │ ├── ActionsAndControllers.md
│ │ ├── GeneratingActions.md
│ │ └── RoutingToActions.md
│ ├── Assets
│ │ ├── Assets.md
│ │ ├── DefaultTasks.md
│ │ ├── DisablingGrunt.md
│ │ └── TaskAutomation.md
│ ├── Blueprints
│ │ ├── Blueprint Actions.md
│ │ ├── Blueprint Routes.md
│ │ └── Blueprints.md
│ ├── Configuration
│ │ ├── Configuration.md
│ │ ├── localjsfile.md
│ │ └── usingsailsrcfiles.md
│ ├── Deployment
│ │ ├── Deployment.md
│ │ ├── FAQ.md
│ │ ├── Hosting.md
│ │ └── Scaling.md
│ ├── E-commerce
│ │ └── E-commerce.md
│ ├── File Uploads
│ │ ├── File Uploads.md
│ │ ├── uploading-to-amazon-s3.md
│ │ └── uploading-to-mongo-gridfs.md
│ ├── Globals
│ │ ├── DisablingGlobals.md
│ │ └── Globals.md
│ ├── Helpers
│ │ ├── ExampleHelper.md
│ │ └── Helpers.md
│ ├── Internationalization
│ │ ├── Internationalization.md
│ │ ├── Locales.md
│ │ └── TranslatingDynamicContent.md
│ ├── Logging
│ │ ├── Custom log messages.md
│ │ └── Logging.md
│ ├── Middleware
│ │ ├── ConventionalDefaults.md
│ │ └── Middleware.md
│ ├── ORM
│ │ ├── Associations
│ │ │ ├── Associations.md
│ │ │ ├── ManytoMany.md
│ │ │ ├── OneWayAssociation.md
│ │ │ ├── OnetoMany.md
│ │ │ ├── OnetoOne.md
│ │ │ ├── Reflexive.md
│ │ │ └── ThroughAssociations.md
│ │ ├── Attributes.md
│ │ ├── Lifecyclecallbacks.md
│ │ ├── Models.md
│ │ ├── ORM.md
│ │ ├── Querylanguage.md
│ │ ├── Records.md
│ │ ├── Validations.md
│ │ ├── errors.md
│ │ ├── model-settings.md
│ │ └── standalone-usage.md
│ ├── Policies
│ │ ├── Permissions.md
│ │ └── Policies.md
│ ├── Programmatic Usage
│ │ ├── Programmatic Usage.md
│ │ └── Tips and Tricks.md
│ ├── README.md
│ ├── Realtime
│ │ ├── Multi-server environments.md
│ │ ├── On the client.md
│ │ ├── On the server.md
│ │ └── Realtime.md
│ ├── Routes
│ │ ├── RouteTargetSyntax.md
│ │ └── Routes.md
│ ├── Security
│ │ ├── CORS.md
│ │ ├── CSRF.md
│ │ ├── Clickjacking.md
│ │ ├── ContentSecurityPolicy.md
│ │ ├── DDOS.md
│ │ ├── P3P.md
│ │ ├── Security.md
│ │ ├── SocketHijacking.md
│ │ ├── StrictTransportSecurity.md
│ │ └── XSS.md
│ ├── Services
│ │ └── Services.md
│ ├── Sessions
│ │ └── sessions.md
│ ├── Testing
│ │ └── Testing.md
│ ├── Views
│ │ ├── Layouts.md
│ │ ├── Locals.md
│ │ ├── Partials.md
│ │ ├── ViewEngines.md
│ │ └── Views.md
│ ├── concepts.md
│ ├── extending-sails
│ │ ├── Adapters
│ │ │ ├── Adapters.md
│ │ │ ├── adapterList.md
│ │ │ └── customAdapters.md
│ │ ├── Custom Responses
│ │ │ ├── AddingCustomResponse.md
│ │ │ └── Custom Responses.md
│ │ ├── Generators
│ │ │ ├── Generators.md
│ │ │ ├── customGenerators.md
│ │ │ └── generatorList.md
│ │ ├── Hooks
│ │ │ ├── Hooks.md
│ │ │ ├── available-hooks.md
│ │ │ ├── events.md
│ │ │ ├── hookspec
│ │ │ │ ├── configure.md
│ │ │ │ ├── defaults.md
│ │ │ │ ├── hookspec.md
│ │ │ │ ├── initialize.md
│ │ │ │ ├── register-actions.md
│ │ │ │ └── routes.md
│ │ │ ├── installablehooks.md
│ │ │ ├── projecthooks.md
│ │ │ └── usinghooks.md
│ │ └── extending-sails.md
│ └── shell-scripts
│ │ └── shell-scripts.md
├── contributing
│ ├── adapter-specification.md
│ ├── code-of-conduct.md
│ ├── code-submission-guidelines
│ │ ├── best-practices.md
│ │ ├── code-submission-guidelines.md
│ │ ├── sending-pull-requests.md
│ │ └── writing-tests.md
│ ├── contributing-to-the-documentation.md
│ ├── contributors-pledge.md
│ ├── core-maintainers.md
│ ├── intro-to-custom-adapters.md
│ ├── issue-contributions.md
│ ├── preface.md
│ ├── proposing-features
│ │ ├── proposing-features.md
│ │ └── submitting-a-proposal.md
│ └── stability-index.md
├── faq
│ ├── README.md
│ └── faq.md
├── irc
│ └── irc.md
├── reference
│ ├── README.md
│ ├── application
│ │ ├── advanced-usage
│ │ │ ├── advanced-usage.md
│ │ │ ├── lifecycle.md
│ │ │ ├── sails.LOOKS_LIKE_ASSET_RX.md
│ │ │ ├── sails.getActions.md
│ │ │ ├── sails.getBaseUrl.md
│ │ │ ├── sails.getRouteFor.md
│ │ │ ├── sails.lift.md
│ │ │ ├── sails.load.md
│ │ │ ├── sails.lower.md
│ │ │ ├── sails.registerAction.md
│ │ │ ├── sails.registerActionMiddleware.md
│ │ │ ├── sails.reloadActions.md
│ │ │ ├── sails.renderView.md
│ │ │ └── sails.request.md
│ │ ├── application.md
│ │ ├── sails.config.custom.md
│ │ ├── sails.getDatastore.md
│ │ ├── sails.getUrlFor.md
│ │ └── sails.log.md
│ ├── blueprint-api
│ │ ├── Add.md
│ │ ├── Create.md
│ │ ├── Destroy.md
│ │ ├── Find.md
│ │ ├── FindOne.md
│ │ ├── Populate.md
│ │ ├── Remove.md
│ │ ├── Replace.md
│ │ ├── Update.md
│ │ └── blueprint-api.md
│ ├── cli
│ │ ├── cli.md
│ │ ├── sailsconsole.md
│ │ ├── sailsdebug.md
│ │ ├── sailsgenerate.md
│ │ ├── sailsinspect.md
│ │ ├── sailslift.md
│ │ ├── sailsnew.md
│ │ └── sailsversion.md
│ ├── reference.md
│ ├── req
│ │ ├── req._startTime.md
│ │ ├── req.accepts.md
│ │ ├── req.acceptsCharsets.md
│ │ ├── req.acceptsLanguages.md
│ │ ├── req.allParams.md
│ │ ├── req.body.md
│ │ ├── req.cookies.md
│ │ ├── req.file.md
│ │ ├── req.fresh.md
│ │ ├── req.get.md
│ │ ├── req.headers.md
│ │ ├── req.host.md
│ │ ├── req.hostname.md
│ │ ├── req.ip.md
│ │ ├── req.ips.md
│ │ ├── req.is.md
│ │ ├── req.isSocket.md
│ │ ├── req.md
│ │ ├── req.method.md
│ │ ├── req.options
│ │ │ └── req.options.md
│ │ ├── req.originalUrl.md
│ │ ├── req.param.md
│ │ ├── req.params.md
│ │ ├── req.path.md
│ │ ├── req.protocol.md
│ │ ├── req.query.md
│ │ ├── req.secure.md
│ │ ├── req.setLocale.md
│ │ ├── req.setTimeout.md
│ │ ├── req.signedCookies.md
│ │ ├── req.socket.md
│ │ ├── req.subdomains.md
│ │ ├── req.url.md
│ │ ├── req.wantsJSON.md
│ │ └── req.xhr.md
│ ├── res
│ │ ├── res.attachment.md
│ │ ├── res.badRequest.md
│ │ ├── res.clearCookie.md
│ │ ├── res.cookie.md
│ │ ├── res.forbidden.md
│ │ ├── res.get.md
│ │ ├── res.json.md
│ │ ├── res.jsonp.md
│ │ ├── res.location.md
│ │ ├── res.md
│ │ ├── res.negotiate.md
│ │ ├── res.notFound.md
│ │ ├── res.ok.md
│ │ ├── res.redirect.md
│ │ ├── res.send.md
│ │ ├── res.serverError.md
│ │ ├── res.set.md
│ │ ├── res.status.md
│ │ ├── res.type.md
│ │ └── res.view.md
│ ├── sails.config
│ │ ├── miscellaneous.md
│ │ ├── sails.config.blueprints.md
│ │ ├── sails.config.bootstrap.md
│ │ ├── sails.config.connections.md
│ │ ├── sails.config.custom.md
│ │ ├── sails.config.globals.md
│ │ ├── sails.config.http.md
│ │ ├── sails.config.i18n.md
│ │ ├── sails.config.log.md
│ │ ├── sails.config.md
│ │ ├── sails.config.models.md
│ │ ├── sails.config.policies.md
│ │ ├── sails.config.routes.md
│ │ ├── sails.config.security.md
│ │ ├── sails.config.session.md
│ │ ├── sails.config.sockets.md
│ │ └── sails.config.views.md
│ ├── waterline
│ │ ├── datastores
│ │ │ ├── datastores.md
│ │ │ ├── driver.md
│ │ │ ├── leaseConnection.md
│ │ │ ├── manager.md
│ │ │ ├── sendNativeQuery.md
│ │ │ └── transaction.md
│ │ ├── models
│ │ │ ├── addToCollection.md
│ │ │ ├── archive.md
│ │ │ ├── archiveOne.md
│ │ │ ├── avg.md
│ │ │ ├── count.md
│ │ │ ├── create.md
│ │ │ ├── createEach.md
│ │ │ ├── destroy.md
│ │ │ ├── destroyOne.md
│ │ │ ├── find.md
│ │ │ ├── findOne.md
│ │ │ ├── findOrCreate.md
│ │ │ ├── getDatastore.md
│ │ │ ├── models.md
│ │ │ ├── native.md
│ │ │ ├── query.md
│ │ │ ├── removeFromCollection.md
│ │ │ ├── replaceCollection.md
│ │ │ ├── stream.md
│ │ │ ├── sum.md
│ │ │ ├── update.md
│ │ │ ├── updateOne.md
│ │ │ └── validate.md
│ │ ├── queries
│ │ │ ├── catch.md
│ │ │ ├── decrypt.md
│ │ │ ├── exec.md
│ │ │ ├── fetch.md
│ │ │ ├── intercept.md
│ │ │ ├── limit.md
│ │ │ ├── meta.md
│ │ │ ├── populate.md
│ │ │ ├── queries.md
│ │ │ ├── skip.md
│ │ │ ├── sort.md
│ │ │ ├── then.md
│ │ │ ├── toPromise.md
│ │ │ ├── tolerate.md
│ │ │ ├── usingConnection.md
│ │ │ └── where.md
│ │ ├── records
│ │ │ ├── records.md
│ │ │ └── toJSON.md
│ │ └── waterline.md
│ └── websockets
│ │ ├── resourceful-pubsub
│ │ ├── get-room-name.md
│ │ ├── publish.md
│ │ ├── resourceful-pubsub.md
│ │ ├── subscribe.md
│ │ └── unsubscribe.md
│ │ ├── sails.io.js
│ │ ├── SailsSocket
│ │ │ ├── SailsSocket.md
│ │ │ ├── methods.md
│ │ │ └── properties.md
│ │ ├── io.sails.md
│ │ ├── io.socket.md
│ │ ├── io.socket.off.md
│ │ ├── io.socket.on.md
│ │ ├── sails.io.js.md
│ │ ├── socket.delete.md
│ │ ├── socket.get.md
│ │ ├── socket.patch.md
│ │ ├── socket.post.md
│ │ ├── socket.put.md
│ │ └── socket.request.md
│ │ ├── sails.sockets
│ │ ├── sails.sockets.addRoomMembersToRooms.md
│ │ ├── sails.sockets.blast.md
│ │ ├── sails.sockets.broadcast.md
│ │ ├── sails.sockets.getid.md
│ │ ├── sails.sockets.id.md
│ │ ├── sails.sockets.join.md
│ │ ├── sails.sockets.leave.md
│ │ ├── sails.sockets.leaveAll.md
│ │ ├── sails.sockets.md
│ │ └── sails.sockets.removeRoomMembersFromRoom.md
│ │ └── websockets.md
├── resources
│ └── styleguide
│ │ ├── Sails-Style-Guide.pdf
│ │ ├── sailslogo_blue.png
│ │ ├── sailslogo_blue@2x.png
│ │ ├── sailslogo_dark.png
│ │ ├── sailslogo_dark@2x.png
│ │ ├── sailslogo_gray.png
│ │ ├── sailslogo_gray@2x.png
│ │ ├── sailslogo_white.png
│ │ └── sailslogo_white@2x.png
├── security
│ ├── README.md
│ └── SAILS-SECURITY-POLICY.md
├── tutorials
│ ├── coffeeScript.md
│ ├── full-stack-javascript.md
│ ├── low-level-mysql-access.md
│ ├── mongo.md
│ ├── tutorials.md
│ └── typeScript.md
├── upgrading
│ ├── To0.10.md
│ ├── To0.11.md
│ ├── To0.12.md
│ ├── To1.0.md
│ └── upgrading.md
└── version-notes
│ ├── 0.10.x
│ ├── 0.10.x.md
│ ├── Changelog0.10.0-rc9.md
│ └── Changelog0.10x.md
│ ├── 0.11.x
│ ├── 0.11.x.md
│ └── MigrationGuide0.11.md
│ ├── 0.12.x
│ ├── 0.12.x.md
│ └── migration-guide-0.12.md
│ ├── 0.8.x
│ ├── 0.8.x.md
│ ├── Changelog0.8.7x.md
│ ├── Changelog0.8.8x.md
│ ├── Changelog0.8.9.md
│ └── ChangelogPre-0.8.77.md
│ ├── 0.9.x
│ ├── 0.9.x.md
│ ├── Changelog0.9.0.md
│ ├── Changelog0.9.16.md
│ ├── Changelog0.9.4.md
│ └── Changelog0.9.7.md
│ └── 1.0.x
│ └── migration-guide-1.0.md
├── errors
├── README.md
├── fatal.js
├── index.js
└── warn.js
├── lib
├── EVENTS.md
├── README.md
├── app
│ ├── README.md
│ ├── Sails.js
│ ├── configuration
│ │ ├── default-hooks.js
│ │ ├── index.js
│ │ ├── load.js
│ │ └── rc.js
│ ├── get-actions.js
│ ├── get-route-for.js
│ ├── get-url-for.js
│ ├── index.js
│ ├── lift.js
│ ├── load.js
│ ├── lower.js
│ ├── private
│ │ ├── after.js
│ │ ├── bootstrap.js
│ │ ├── checkGruntConfig.js
│ │ ├── controller
│ │ │ ├── README.md
│ │ │ ├── help-register-action.js
│ │ │ └── load-action-modules.js
│ │ ├── exposeGlobals.js
│ │ ├── initialize.js
│ │ ├── inspect.js
│ │ ├── isLocalSailsValid.js
│ │ ├── isSailsAppSync.js
│ │ ├── loadHooks.js
│ │ ├── toJSON.js
│ │ └── toString.js
│ ├── register-action-middleware.js
│ ├── register-action.js
│ ├── reload-actions.js
│ └── request.js
├── hooks
│ ├── README.md
│ ├── blueprints
│ │ ├── README.md
│ │ ├── actionUtil.js
│ │ ├── actions
│ │ │ ├── add.js
│ │ │ ├── create.js
│ │ │ ├── destroy.js
│ │ │ ├── find.js
│ │ │ ├── findOne.js
│ │ │ ├── populate.js
│ │ │ ├── remove.js
│ │ │ ├── replace.js
│ │ │ └── update.js
│ │ ├── formatUsageError.js
│ │ ├── index.js
│ │ ├── onRoute.js
│ │ └── parse-blueprint-options.js
│ ├── helpers
│ │ ├── index.js
│ │ └── private
│ │ │ ├── iterate-helpers.js
│ │ │ └── load-helpers.js
│ ├── http
│ │ ├── README.md
│ │ ├── default-favicon.ico
│ │ ├── get-configured-http-middleware-fns.js
│ │ ├── index.js
│ │ ├── initialize.js
│ │ ├── start.js
│ │ └── view.js
│ ├── i18n
│ │ └── index.js
│ ├── index.js
│ ├── logger
│ │ ├── README.md
│ │ ├── index.js
│ │ └── ship.js
│ ├── moduleloader
│ │ ├── README.md
│ │ └── index.js
│ ├── policies
│ │ ├── README.md
│ │ └── index.js
│ ├── pubsub
│ │ ├── README.md
│ │ └── index.js
│ ├── request
│ │ ├── README.md
│ │ ├── index.js
│ │ ├── locals.js
│ │ ├── metadata.js
│ │ ├── param.js
│ │ ├── params.all.js
│ │ ├── qualifiers.js
│ │ └── validate.js
│ ├── responses
│ │ ├── README.md
│ │ ├── defaults
│ │ │ ├── badRequest.js
│ │ │ ├── forbidden.js
│ │ │ ├── negotiate.js
│ │ │ ├── notFound.js
│ │ │ ├── ok.js
│ │ │ └── serverError.js
│ │ ├── index.js
│ │ └── onRoute.js
│ ├── security
│ │ ├── README.md
│ │ ├── cors
│ │ │ ├── index.js
│ │ │ ├── set-headers.js
│ │ │ └── set-preflight-config.js
│ │ ├── csrf
│ │ │ ├── grant-csrf-token.js
│ │ │ └── index.js
│ │ └── index.js
│ ├── services
│ │ └── index.js
│ ├── session
│ │ ├── README.md
│ │ └── index.js
│ ├── userconfig
│ │ ├── README.md
│ │ └── index.js
│ ├── userhooks
│ │ ├── README.md
│ │ └── index.js
│ └── views
│ │ ├── configure.js
│ │ ├── default-view-rendering-fn.js
│ │ ├── escape-html-entities-deep.js
│ │ ├── get-implicit-defaults.js
│ │ ├── html-scriptify.js
│ │ ├── index.js
│ │ ├── onRoute.js
│ │ ├── render.js
│ │ ├── res.view.js
│ │ ├── stat-views.js
│ │ └── unescape-html-entities-deep-lite.min.string.js
├── index.js
├── router
│ ├── README.md
│ ├── bind.js
│ ├── bindDefaultHandlers.js
│ ├── index.js
│ ├── mock-req.js
│ ├── mock-res.js
│ ├── req.js
│ └── res.js
└── util
│ ├── check-origin-url.js
│ └── detect-verb.js
├── package.json
└── test
├── .eslintrc
├── README.md
├── benchmarks
├── README.md
├── helpers
│ └── benchmarx.js
├── sails.load.test.js
└── sails.request.generic.test.js
├── fixtures
├── constants.js
├── customHooks.js
└── middleware.js
├── helpers
├── RouteFactory.helper.js
├── router.js
├── sails.js
├── test-spawning-sails-child-process-in-cwd.js
└── test-spawning-sails-lift-child-process-in-cwd.js
├── hooks
├── blueprints
│ └── initialize.test.js
├── http
│ └── initialize.test.js
├── pubsub
│ └── initialize.test.js
├── request
│ ├── initialize.test.js
│ ├── req.metadata.test.js
│ └── req.options.sticky.test.js
└── views
│ ├── ejs
│ └── index.i18n.ejs
│ ├── intialize.test.js
│ ├── locales
│ ├── en.json
│ ├── es.json
│ └── eu.json
│ ├── res.render.i18n.js
│ ├── res.view.test.js
│ └── skipAssets.test.js
├── init.js
├── integration
├── README.md
├── cert
│ ├── sailstest-cert.pem
│ └── sailstest-key.pem
├── fixtures
│ ├── favicon.ico
│ ├── hooks
│ │ └── installable
│ │ │ ├── add-policy
│ │ │ ├── index.js
│ │ │ └── package.json
│ │ │ ├── async
│ │ │ └── index.js.txt
│ │ │ └── shout
│ │ │ ├── index.js
│ │ │ └── package.json
│ ├── sampleapp
│ │ ├── api
│ │ │ ├── controllers
│ │ │ │ ├── EmptyController.js
│ │ │ │ ├── PetController.js
│ │ │ │ ├── QuizController.js
│ │ │ │ ├── TestController.js
│ │ │ │ ├── UserController.js
│ │ │ │ ├── UserProfileController.js
│ │ │ │ └── ViewTestController.js
│ │ │ ├── models
│ │ │ │ ├── Empty.js
│ │ │ │ ├── Pet.js
│ │ │ │ ├── Quiz.js
│ │ │ │ ├── Test.js
│ │ │ │ ├── User.js
│ │ │ │ └── UserProfile.js
│ │ │ ├── policies
│ │ │ │ ├── error_policy.js
│ │ │ │ └── fake_auth.js
│ │ │ └── services
│ │ │ │ └── TestService.js
│ │ ├── config
│ │ │ └── local.js
│ │ └── views
│ │ │ ├── app
│ │ │ ├── index.ejs
│ │ │ └── user
│ │ │ │ └── homepage.ejs
│ │ │ ├── pages
│ │ │ └── homepage.ejs
│ │ │ └── viewtest
│ │ │ ├── create.ejs
│ │ │ ├── csrf.ejs
│ │ │ ├── index.ejs
│ │ │ └── viewOptions.ejs
│ └── users.js
├── generate.test.js
├── globals.test.js
├── helpers
│ ├── appHelper.js
│ ├── httpHelper.js
│ └── socketHelper.js
├── hook.3rdparty.test.js
├── hook.blueprints.action.routes.test.js
├── hook.blueprints.blacklist.test.js
├── hook.blueprints.index.routes.test.js
├── hook.blueprints.restful.routes.test.js
├── hook.blueprints.shortcut.routes.test.js
├── hook.cors.test.js
├── hook.csrf.test.js
├── hook.helpers.test.js
├── hook.i18n.test.js
├── hook.policies.test.js
├── hook.pubsub.modelEvents.noSubscribers.test.js
├── hook.pubsub.modelEvents.subscribers.test.js
├── hook.sockets.interpreter.test.js
├── hook.userconfig.test.js
├── hook.views.test.js
├── hooks.user.test.js
├── lift.https.test.js
├── lift.lower.test.js
├── lift.test.js
├── middleware.404.test.js
├── middleware.500.test.js
├── middleware.compression.test.js
├── middleware.cookieParser.test.js
├── middleware.favicon.test.js
├── middleware.handleBodyParserError.test.js
├── middleware.sails.test.js
├── middleware.session.redis.test.js
├── middleware.session.test.js
├── middleware.startRequestTimer.test.js
├── middleware.static.test.js
├── new.test.js
├── router.params.test.js
├── router.specifiedRoutes.test.js
├── router.viewRendering.test.js
└── www.test.js
├── mocha.opts
└── unit
├── App.prototype.load.test.js
├── README.md
├── app.getRouteFor.test.js
├── app.getUrlFor.test.js
├── app.initializeHooks.test.js
├── app.lower.test.js
├── app.registerAction.test.js
├── app.reloadActions.test.js
├── bootstrap.test.js
├── controller.test.js
├── req.errors.test.js
├── req.session.test.js
├── req.test.js
├── res.test.js
├── router.bind.test.js
├── router.ordering.test.js
├── router.test.js
├── router.unbind.test.js
└── virtual-request-interpreter.test.js
/.editorconfig:
--------------------------------------------------------------------------------
1 | # ╔═╗╔╦╗╦╔╦╗╔═╗╦═╗┌─┐┌─┐┌┐┌┌─┐┬┌─┐
2 | # ║╣ ║║║ ║ ║ ║╠╦╝│ │ ││││├┤ ││ ┬
3 | # o╚═╝═╩╝╩ ╩ ╚═╝╩╚═└─┘└─┘┘└┘└ ┴└─┘
4 | #
5 | # This file (`.editorconfig`) exists to help maintain consistent formatting
6 | # throughout this package, the Sails framework, and the Node-Machine project.
7 | #
8 | # To review what each of these options mean, see:
9 | # http://editorconfig.org/
10 | root = true
11 |
12 | [*]
13 | indent_style = space
14 | indent_size = 2
15 | end_of_line = lf
16 | charset = utf-8
17 | trim_trailing_whitespace = true
18 | insert_final_newline = true
19 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE:
--------------------------------------------------------------------------------
1 | **Node version**:
2 | **Sails version** _(sails)_:
3 | **ORM hook version** _(sails-hook-orm)_:
4 | **Sockets hook version** _(sails-hook-sockets)_:
5 | **Organics hook version** _(sails-hook-organics)_:
6 | **Grunt hook version** _(sails-hook-grunt)_:
7 | **Uploads hook version** _(sails-hook-uploads)_:
8 | **DB adapter & version** _(e.g. sails-mysql@5.55.5)_:
9 | **Skipper adapter & version** _(e.g. skipper-s3@5.55.5)_:
10 |
11 |
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # ┌─┐┬┌┬┐╦╔═╗╔╗╔╔═╗╦═╗╔═╗
2 | # │ ┬│ │ ║║ ╦║║║║ ║╠╦╝║╣
3 | # o└─┘┴ ┴ ╩╚═╝╝╚╝╚═╝╩╚═╚═╝
4 | #
5 | # This file (`.gitignore`) exists to signify to `git` that certain files
6 | # and/or directories should be ignored for the purposes of version control.
7 | #
8 | # This is primarily useful for excluding temporary files of all sorts; stuff
9 | # generated by IDEs, build scripts, automated tests, package managers, or even
10 | # end-users (e.g. file uploads). `.gitignore` files like this also do a nice job
11 | # at keeping sensitive credentials and personal data out of version control systems.
12 | #
13 |
14 | ############################
15 | # sails / node.js / npm
16 | ############################
17 | node_modules
18 | .tmp
19 | npm-debug.log
20 | package-lock.json
21 | package-lock.*
22 | .waterline
23 | .node_history
24 |
25 | ############################
26 | # editor & OS files
27 | ############################
28 | *.swo
29 | *.swp
30 | *.swn
31 | *.swm
32 | *.seed
33 | *.log
34 | *.out
35 | *.pid
36 | lib-cov
37 | .DS_STORE
38 | *#
39 | *\#
40 | .\#*
41 | *~
42 | .idea
43 | .netbeans
44 | nbproject
45 |
46 | ############################
47 | # misc
48 | ############################
49 | dump.rdb
50 |
--------------------------------------------------------------------------------
/.npmignore:
--------------------------------------------------------------------------------
1 | .git
2 | ./.gitignore
3 | ./.jshintrc
4 | ./.editorconfig
5 | ./.travis.yml
6 | ./appveyor.yml
7 | ./example
8 | ./examples
9 | ./test
10 | ./tests
11 | ./sails-docs
12 | ./.github
13 |
14 | node_modules
15 | npm-debug.log
16 | .node_history
17 | *.swo
18 | *.swp
19 | *.swn
20 | *.swm
21 | *.seed
22 | *.log
23 | *.out
24 | *.pid
25 | lib-cov
26 | .DS_STORE
27 | *#
28 | *\#
29 | .\#*
30 | *~
31 | .idea
32 | .netbeans
33 | nbproject
34 | .tmp
35 | dump.rdb
36 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
2 | # ╔╦╗╦═╗╔═╗╦ ╦╦╔═╗ ┬ ┬┌┬┐┬ #
3 | # ║ ╠╦╝╠═╣╚╗╔╝║╚═╗ └┬┘││││ #
4 | # o ╩ ╩╚═╩ ╩ ╚╝ ╩╚═╝o ┴ ┴ ┴┴─┘ #
5 | # #
6 | # This file configures Travis CI. #
7 | # (i.e. how we run the tests... mainly) #
8 | # #
9 | # https://docs.travis-ci.com/user/customizing-the-build #
10 | # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
11 |
12 | language: node_js
13 |
14 | node_js:
15 | - "10"
16 | - "12"
17 | - "14"
18 | - "16"
19 |
20 | branches:
21 | only:
22 | - master
23 |
24 | notifications:
25 | email:
26 | - ci@sailsjs.com
27 |
28 | env:
29 | TEST_REDIS_SESSION=true
30 |
31 | before_script: sudo redis-server /etc/redis/redis.conf --port 6380 --requirepass 'secret'
32 |
--------------------------------------------------------------------------------
/CODE-OF-CONDUCT.md:
--------------------------------------------------------------------------------
1 | > The Code of Conduct now lives in the 'Contributing' section of the documentation: [http://sailsjs.com/documentation/contributing/code-of-conduct](http://sailsjs.com/documentation/contributing/code-of-conduct)
2 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | > The Contribution guide now lives in the 'Contributing' section of the documentation: [sailsjs.com/documentation/contributing](http://sailsjs.com/documentation/contributing)
2 |
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 | --
3 |
4 | Copyright © 2012-present, Mike McNeil
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
7 |
8 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
9 |
10 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
11 |
--------------------------------------------------------------------------------
/accessible/generate.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Module dependencies
3 | */
4 |
5 | var sailsgen = require('sails-generate');
6 |
7 | // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
8 | // TODO: Remove this at next opportunity to simplify maintenance.
9 | // (Check docs, but I don't think it's documented, and it's not being used
10 | // anywhere anymore. Now that NPM is faster than it used to be, there's no
11 | // reason to work towards separating the core generators from the main
12 | // framework's NPM package anymore. So this doesn't really need to exist,
13 | // unless there are a lot of really good use cases for why generators need to be
14 | // easily expoed for programmatic usage. If you have such a use case, let us
15 | // know at https://sailsjs.com/bugs)
16 | //
17 | // But note that this is a breaking change.
18 | // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
19 |
20 |
21 | /**
22 | * require('sails/accessible/generate')
23 | *
24 | * Generate files or folders.
25 | *
26 | * > This is an exposed version of sails-generate for programmatic use.
27 | * > (available on `require('sails').Sails.generate()`)
28 | *
29 | * @param {Dictionary} scope
30 | * @param {Function|Dictionary} cbOrHandlers
31 | */
32 | module.exports = function generate (){
33 |
34 | return sailsgen.apply(this, Array.prototype.slice.call(arguments));
35 |
36 | };
37 |
38 |
--------------------------------------------------------------------------------
/accessible/rc.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Module dependencies
3 | */
4 |
5 | var rc = require('../lib/app/configuration/rc');
6 |
7 |
8 | /**
9 | * require('sails/accessible/rc')
10 | *
11 | * A direct reference to Sails' built-in `rc` dependency.
12 | *
13 | * > This should not be modified.
14 | * > It's job is to eliminate the need for an extra `rc` dep. in userland
15 | * > just to load cmdline config in app.js.
16 | *
17 | * @type {Ref}
18 | */
19 | module.exports = rc;
20 |
--------------------------------------------------------------------------------
/bin/private/patched-commander.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Module dependencies
3 | */
4 |
5 | var _ = require('@sailshq/lodash');
6 | var program = require('commander');
7 |
8 |
9 | //
10 | //
11 | // Monkey-patch commander
12 | //
13 | //
14 |
15 | // Override the `usage` method to always strip out the `*` command,
16 | // which we added so that `sails someunknowncommand` will output
17 | // the Sails help message instead of nothing.
18 | var usage = program.Command.prototype.usage;
19 | program.Command.prototype.usage = program.usage = function( /* str */ ) {
20 | program.commands = _.reject(program.commands, {
21 | _name: '*'
22 | });
23 | return usage.apply(this, Array.prototype.slice.call(arguments));
24 | };
25 |
26 | // Force commander to display version information.
27 | program.Command.prototype.versionInformation = program.versionInformation = function() {
28 | program.emit('version');
29 | };
30 |
31 | module.exports = program;
32 |
--------------------------------------------------------------------------------
/bin/sails-debug.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Module dependencies
3 | */
4 |
5 | var path = require('path');
6 | var Womb = require('child_process');
7 | var CaptainsLog = require('captains-log');
8 | var chalk = require('chalk');
9 | var Sails = require('../lib/app');
10 |
11 |
12 | /**
13 | * `sails debug`
14 | *
15 | * Attach the Node debugger and lift a Sails app.
16 | * You can then use Node inspector to debug your app as it runs.
17 | *
18 | * @stability 2
19 | * @see http://sailsjs.com/documentation/reference/command-line-interface/sails-debug
20 | */
21 | module.exports = function(cmd) {
22 |
23 | var extraArgs = cmd.parent.rawArgs.slice(3);
24 |
25 | var log = CaptainsLog();
26 |
27 | // Use the app's local Sails in `node_modules` if one exists
28 | // But first make sure it'll work...
29 | var appPath = process.cwd();
30 | var pathToSails = path.resolve(appPath, '/node_modules/sails');
31 | if (!Sails.isLocalSailsValid(pathToSails, appPath)) {
32 | // otherwise, use the currently-running instance of Sails
33 | pathToSails = path.resolve(__dirname, './sails.js');
34 | }
35 |
36 | console.log();
37 | log.info('Running app in debug mode...');
38 |
39 | log.info(chalk.grey('( to exit, type ' + '+' + ' )'));
40 | console.log();
41 |
42 | // Spin up child process for Sails
43 | Womb.spawn('node', ['--debug', pathToSails, 'lift'].concat(extraArgs), {
44 | stdio: 'inherit'
45 | });
46 |
47 | };
48 |
--------------------------------------------------------------------------------
/docs/PAGE_NEEDED.md:
--------------------------------------------------------------------------------
1 | # Page Needed
2 |
3 | If you’re seeing this page, it means you've clicked on a link to a Sails doc that has yet to be written. Help make Sails better by contributing to the docs!
4 |
5 | Please send a pull request to master with corrections/additions and they'll be double-checked and merged as soon as possible.
6 |
7 | Secondly, we are open to suggestions about the process we're using to manage our documentation, and to work with the community in general. Please post to the Google Group with your ideas, or if you're interested in helping directly, contact @fancydoilies, @aaaaanxiety, or @mikermcneil on Twitter.
8 |
9 | Love,
10 |
11 | The Sails Team
12 |
--------------------------------------------------------------------------------
/docs/anatomy/.editorconfig.md:
--------------------------------------------------------------------------------
1 | # .editorconfig
2 |
3 | This file exists to help maintain consistent formatting throughout the files in your Sails app.
4 |
5 | For more information, see [editorconfig.org](http://editorconfig.org/).
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/docs/anatomy/.eslintignore.md:
--------------------------------------------------------------------------------
1 | # .eslintignore
2 |
3 | This file exists to signify to [ESLint](https://eslint.org/) that certain files and/or directories should be ignored for the purposes of linting.
4 |
5 |
6 |
--------------------------------------------------------------------------------
/docs/anatomy/.eslintrc.md:
--------------------------------------------------------------------------------
1 | # .eslintrc
2 |
3 | This file defines a set of basic code conventions designed to encourage quality and consistency across your Sails app's code base.
4 |
5 | For more information, see [eslint.org](https://eslint.org/).
6 |
7 |
8 |
--------------------------------------------------------------------------------
/docs/anatomy/.htmlhintrc.md:
--------------------------------------------------------------------------------
1 | # .htmlhintrc
2 |
3 | This file defines the rules for your app's [HTMLHint](http://htmlhint.com/), to encourage quality and consistency in your views and templates.
4 |
5 |
6 |
--------------------------------------------------------------------------------
/docs/anatomy/Gruntfile.js.md:
--------------------------------------------------------------------------------
1 | # Gruntfile.js
2 |
3 |
4 | Sails uses [Grunt](http://gruntjs.com) for asset management. This file contains the entry point for the default asset pipeline in Sails; that is, the code that does stuff like compiling LESS stylesheets, minifying scripts for production, and precompiling and injecting client-side templates.
5 |
6 | Sails' integration with Grunt is fully customizable, but for most use cases, this file (`Gruntfile.js`) should remain unchanged. Instead, you can install Grunt plugins or add your own custom logic as new files in the [`tasks/`](./tasks) folder.
7 |
8 | > + To learn more about working with static assets in Sails, check out the [conceptual documentation on assets](https://sailsjs.com/documentation/concepts/assets).
9 | > + For a broader introduction to Grunt tasks in general, see [Grunt's docs on configuring tasks](http://gruntjs.com/configuring-tasks).
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/docs/anatomy/README.md:
--------------------------------------------------------------------------------
1 | # docs/anatomy
2 |
3 | This section contains the "Anatomy" documentation which is eventually available at https://sailsjs.com/documentation/anatomy.
4 |
5 | ### Notes
6 | > - This README file **is not compiled to HTML** for the website. It is just here to explain what you're looking at.
7 | > - Depending on what branch of `sails` you are currently viewing, the domain may vary. See the top-level documentation README file for information about working with the markdown files in this repo, and to understand the branching/versioning strategy.
8 |
9 |
10 |
--------------------------------------------------------------------------------
/docs/anatomy/README.md.md:
--------------------------------------------------------------------------------
1 | # README.md
2 |
3 | This is a generic README that you can edit to describe your app.
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/docs/anatomy/anatomy.md:
--------------------------------------------------------------------------------
1 | # Anatomy of a Sails app
2 |
3 | An interactive guide to the structure of the Sails app generated by default with `sails new`.
4 |
5 | Choose from any of the files or folders in the list to learn more about its purpose.
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/docs/anatomy/api/controllers/controllers.md:
--------------------------------------------------------------------------------
1 | # api/controllers/
2 |
3 | This is the directory that holds your controllers. In Sails, controllers are JavaScript files that contain logic for interacting with models and rendering appropriate views to the client.
4 |
5 | When you call `sails generate api cats` via the command line from inside your project's root directory, Sails will generate the file `api/controllers/CatsController.js` along with a matching model.
6 |
7 | The `api/controllers` directory can also contain _standalone actions_, which are JavaScript files containing a _single_ controller action, rather than a dictionary of actions.
8 |
9 | See the [main actions and controllers documentation](https://sailsjs.com/documentation/concepts/actions-and-controllers) for more info.
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/docs/anatomy/api/controllers/gitkeep.md:
--------------------------------------------------------------------------------
1 | # api/controllers/.gitkeep
2 |
3 | Ignore this file. It only exists because `git` refuses to push empty directories to a remote server. `.gitkeep` is an unofficial convention that has emerged as a workaround for people who don't discriminate against empty directories.
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/docs/anatomy/api/helpers/.gitkeep.md:
--------------------------------------------------------------------------------
1 | # api/helpers/.gitkeep
2 |
3 | Ignore this file. It only exists because `git` refuses to push empty directories to a remote server. `.gitkeep` is an unofficial convention that has emerged as a workaround for people who don't discriminate against empty directories.
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/docs/anatomy/api/helpers/helpers.md:
--------------------------------------------------------------------------------
1 | # api/helpers/
2 |
3 | This is the directory that holds your helpers. In Sails, helpers are shared functions that can be called from anywhere in your app.
4 |
5 | When you call `sails generate helper tickle-user` via the command line from inside your project's root directory, Sails will generate the file `api/helpers/tickle-user.js`, with a skeleton helper file to get you started.
6 |
7 | See the [main helpers documentation](https://sailsjs.com/documentation/concepts/helpers) for more info.
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/docs/anatomy/api/models/.gitkeep.md:
--------------------------------------------------------------------------------
1 | # api/models/.gitkeep
2 |
3 | Ignore this file. It only exists because `git` refuses to push empty directories to a remote server. `.gitkeep` is an unofficial convention that has emerged as a workaround for people who don't discriminate against empty directories.
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/docs/anatomy/api/models/models.md:
--------------------------------------------------------------------------------
1 | # api/models/
2 |
3 | This is the directory that holds your models. In Sails, models are the structures that contain data for your Sails App.
4 |
5 | You can learn more about how to define and use models in [Concepts > Models and ORM > Models](https://sailsjs.com/documentation/concepts/models-and-orm/models), and about how to generate them [here](https://sailsjs.com/documentation/reference/command-line-interface/sails-generate#?core-generators).
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/docs/anatomy/api/policies/.gitkeep.md:
--------------------------------------------------------------------------------
1 | # api/policies/.gitkeep
2 |
3 | Ignore this file. It only exists because `git` refuses to push empty directories to a remote server. `.gitkeep` is an unofficial convention that has emerged as a workaround for people who don't discriminate against empty directories.
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/docs/anatomy/api/policies/policies.md:
--------------------------------------------------------------------------------
1 | # api/policies/
2 |
3 | This is the folder you will store your “policy” files in. A policy file is a JavaScript file that contains what is essentially Express middleware for authenticating access to controller actions in your app.
4 |
5 | For example, if you want to make sure only authenticated admin users can access `http://yourapp.com/admin/dashboard`, this is the folder you would put that logic in.
6 |
7 | For more information about policies and how to use them in your app, see [Concepts > Policies](https://sailsjs.com/documentation/concepts/policies).
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/docs/anatomy/app.js.md:
--------------------------------------------------------------------------------
1 | # app.js
2 |
3 | This file is the conventional entry point for a _production_ Sails/Node.js app.
4 |
5 | When developing on your local computer, and you run `sails lift`, the code in `app.js` is not executed. Instead, this file exists to provide an easy, out-of-the-box way to run your app _without_ typing `sails lift`. This is most likely how you'll start your app in production (i.e. `node app`, or `npm start`).
6 |
7 | For example, when you deploy to most PaaS vendors like [Heroku](http://heroku.com), they will automatically detect that you're running a Sails/Node.js app and execute this file with the `NODE_ENV` environment variable set to production.
8 |
9 | > Whatever stage of the development lifecycle you're at, you can safely ignore `app.js`. It's good to go out of the box for most apps. But the code in `app.js` also serves as an easy-to-reference example of how to use Sails programmatically. So you might want to take a look at it if you plan on writing automated tests, scheduled jobs, manual database migrations, or administration scripts.
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/docs/anatomy/assets/.eslintrc.md:
--------------------------------------------------------------------------------
1 | # assets/.eslintrc
2 |
3 | This file is for [ESLint](https://eslint.org/) configuration overrides for the `assets/` directory.
4 |
5 | These override the code conventions defined in the top-level [`.eslintrc`](https://sailsjs.com/documentation/anatomy/.eslintrc), to allow for variations between front-end JavaScript code vs. backend code designed to run in a Node.js/Sails process.
6 |
7 |
8 |
--------------------------------------------------------------------------------
/docs/anatomy/assets/assets.md:
--------------------------------------------------------------------------------
1 | # assets/
2 |
3 | This is your assets folder. It houses all of the static files that your app will need to host. Feel free to create your own files and folders in here. Upon lifting, a file called `assets/newFolder/data.txt` could be accessed at `http://localhost:1337/newFolder/data.txt`.
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/docs/anatomy/assets/dependencies/dependencies.md:
--------------------------------------------------------------------------------
1 | # assets/dependencies/
2 |
3 | As a rule of thumb, if it's code written by you or someone on your team, it _does not belong in this folder._ Instead, `assets/dependencies/` is for your client-side dependencies such as Vue.js, Bootstrap, or jQuery. This folder can include client-side JavaScript files, stylesheets, and even images. (See the "Web App" template for an example.)
4 |
5 | JavaScript files and stylesheets in the `assets/dependencies/` folder are loaded first, before your other assets. This conventional behavior is orchestrated by [tasks/pipeline.js](https://sailsjs.com/documentation/anatomy/tasks/pipeline.js), so head over there if you need to tweak this behavior (for example, if some of your client-side dependencies need to load before others.)
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/docs/anatomy/assets/dependencies/sails.io.js.md:
--------------------------------------------------------------------------------
1 | # assets/dependencies/sails.io.js
2 |
3 |
4 | This file adds a few custom methods to socket.io which provide the "built-in" websockets functionality for Sails.
5 |
6 | Specifically, those methods allow you to send and receive Socket.IO messages to and from Sails by simulating a REST client interface on top of Socket.IO. It models its API after the $.ajax pattern from jQuery which you might be familiar with.
7 |
8 | See the [Socket client reference](https://sailsjs.com/documentation/reference/web-sockets/socket-client) for more info about using the methods that this file provides.
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/docs/anatomy/assets/favicon.ico.md:
--------------------------------------------------------------------------------
1 | # assets/favicon.ico
2 |
3 | This file is the [Favicon](http://en.wikipedia.org/wiki/Favicon) for your app.
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/docs/anatomy/assets/images/gitkeep.md:
--------------------------------------------------------------------------------
1 | # assets/images/.gitkeep
2 |
3 |
4 | Ignore this file. It only exists because `git` refuses to push empty directories to a remote server. `.gitkeep` is an unofficial convention that has emerged as a workaround for people who don't discriminate against empty directories.
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/docs/anatomy/assets/images/images.md:
--------------------------------------------------------------------------------
1 | # assets/images/
2 |
3 | This is where you should put image files that need to be statically hosted by your app.
4 |
5 | Upon lifting your app, an image called `omgCat.jpg` could be found at `http://localhost:1337/images/omgCat.jpg`
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/docs/anatomy/assets/js/gitkeep.md:
--------------------------------------------------------------------------------
1 | # assets/js/.gitkeep
2 |
3 | Ignore this file. It only exists because `git` refuses to push empty directories to a remote server. `.gitkeep` is an unofficial convention that has emerged as a workaround for people who don't discriminate against empty directories.
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/docs/anatomy/assets/js/js.md:
--------------------------------------------------------------------------------
1 | # assets/js/
2 |
3 | This is where you put client-side JavaScript files that you want to be statically hosted by your app. Sails puts a few in there for making communication via socket.io easier.
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/docs/anatomy/assets/styles/importer.less.md:
--------------------------------------------------------------------------------
1 | # assets/styles/importer.less
2 |
3 | By default, new Sails projects are configured to compile this file from LESS to CSS. Unlike CSS files, LESS files are not compiled and included automatically unless they are imported here.
4 |
5 | The LESS files imported in this file are compiled and included in the order they are listed. Mixins, variables, etc. should be imported first so that they can be accessed by subsequent LESS stylesheets.
6 |
7 | (Just like the rest of the asset pipeline bundled in Sails, you can always omit, customize, or replace this behavior with SASS, SCSS, or any other Grunt tasks you like.)
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/docs/anatomy/assets/styles/styles.md:
--------------------------------------------------------------------------------
1 | # assets/styles/
2 |
3 | This is where you will put all of the .css files that you would like to be statically hosted by your app.
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/docs/anatomy/assets/templates/gitkeep.md:
--------------------------------------------------------------------------------
1 | # assets/templates/.gitkeep
2 |
3 | Ignore this file. It only exists because `git` refuses to push empty directories to a remote server. `.gitkeep` is an unofficial convention that has emerged as a workaround for people who don't discriminate against empty directories.
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/docs/anatomy/config/blueprints.js.md:
--------------------------------------------------------------------------------
1 | # config/blueprints.js
2 |
3 | This file is for the configuration of blueprint routes and actions.
4 |
5 | For an overview of blueprints, see the [main Blueprints API concepts docs](https://sailsjs.com/documentation/concepts/blueprints). For more information on configuring the blueprint API, check out the [reference documentation on blueprints](https://sailsjs.com/documentation/reference/configuration/sails-config-blueprints).
6 |
7 | ### Usage
8 |
9 | See [`sails.config.blueprints`](https://sailsjs.com/documentation/reference/configuration/sails-config-blueprints) for all available options.
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/docs/anatomy/config/bootstrap.js.md:
--------------------------------------------------------------------------------
1 | # config/bootstrap.js
2 |
3 | This is a server-side JavaScript file that is executed by Sails just before your app is lifted.
4 |
5 | This gives you an opportunity to set up your data model, run jobs, or perform some special logic.
6 |
7 | ### Usage
8 |
9 | See [`sails.config.bootstrap`](https://sailsjs.com/documentation/reference/configuration/sails-config-bootstrap) for more info.
10 |
11 |
12 |
--------------------------------------------------------------------------------
/docs/anatomy/config/config.md:
--------------------------------------------------------------------------------
1 | # config/
2 |
3 | This folder contains various files that will allow you to customize and configure your Sails app.
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/docs/anatomy/config/custom.js.md:
--------------------------------------------------------------------------------
1 | # config/custom
2 |
3 | This is your custom configuration file. It is useful for one-off settings specific to your application-- like your base URL for linkbacks, the no-reply "From" address to use when sending automated emails, or 3rd party API keys for Stripe, Mailgun, Twilio, etc.
4 |
5 | > Use [`sails.config.custom`](https://sailsjs.com/documentation/reference/application/sails-config-custom) to access these values from your actions and helpers.
6 |
7 | You can learn more about custom configuration [here](https://sailsjs.com/documentation/reference/configuration/sails-config-custom).
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/docs/anatomy/config/datastores.js.md:
--------------------------------------------------------------------------------
1 | # config/datastores
2 |
3 | A set of datastore configurations which tell Sails where to fetch or save data when you execute built-in model methods like `.find()` and `.create()`.
4 |
5 | > This file is mainly useful for configuring your development database, as well as any additional one-off databases used by individual models.
6 |
7 | ### Usage
8 |
9 | See [`sails.config.datastores`](https://sailsjs.com/documentation/reference/configuration/sails-config-datastores) for all available options.
10 |
11 |
12 |
--------------------------------------------------------------------------------
/docs/anatomy/config/env/env.md:
--------------------------------------------------------------------------------
1 | # config/env/
2 |
3 | This folder contains various environment-specific settings such as API keys or remote database passwords. Depending on the environment Sails is lifted in, the appropriate configuration file in this folder will load. To read more about environent-specific config in Sails, see [**Concepts > Configuration**](https://sailsjs.com/documentation/concepts/configuration#?environmentspecific-files-config-env).
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/docs/anatomy/config/env/production.js.md:
--------------------------------------------------------------------------------
1 | # config/env/production.js
2 |
3 | This file will be loaded when Sails is running in `production` mode. If using the CLI command `sails lift --prod`, these settings will be loaded.
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/docs/anatomy/config/globals.js.md:
--------------------------------------------------------------------------------
1 | # config/globals.js
2 |
3 | Configuration for the global variables Sails exposes to its Node process.
4 |
5 | ### Usage
6 |
7 | See [`sails.config.globals`](https://sailsjs.com/documentation/reference/configuration/sails-config-globals) for all available options.
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/docs/anatomy/config/http.js.md:
--------------------------------------------------------------------------------
1 | # config/http.js
2 |
3 | This file is for configuring the underlying HTTP server in Sails, as well as any HTTP middleware your app may need.
4 |
5 | ### Usage
6 |
7 | See [`sails.config.http`](https://sailsjs.com/documentation/reference/configuration/sails-config-http) for all available options.
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/docs/anatomy/config/i18n.js.md:
--------------------------------------------------------------------------------
1 | # config/i18n.js
2 |
3 | This file contains your Sails app's internationalization settings.
4 |
5 | ### Usage
6 |
7 | See [`sails.config.i18n`](https://sailsjs.com/documentation/reference/configuration/sails-config-i-18-n) for all available options.
8 |
9 |
10 |
--------------------------------------------------------------------------------
/docs/anatomy/config/local.js.md:
--------------------------------------------------------------------------------
1 | # config/local.js
2 |
3 | This file is used to specify configuration settings for use while developing the app on your personal system.
4 |
5 | For more information, check out [Concepts > Configuration > The local.js file](https://sailsjs.com/docs/concepts/configuration/the-local-js-file)
6 |
7 | > Since `config/local.js` is usually used to store sensitive credentials, it is included in your app's [.gitignore](https://sailsjs.com/documentation/anatomy/.gitignore), and isn't pushed to the remote server. If you click the link to this file below, you should see a 404 page; in this case, that's a _good_ thing!
8 |
9 |
10 |
--------------------------------------------------------------------------------
/docs/anatomy/config/locales/de.json.md:
--------------------------------------------------------------------------------
1 | # config/locales/de.json
2 |
3 | This file is where German locale information is stored.
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/docs/anatomy/config/locales/en.json.md:
--------------------------------------------------------------------------------
1 | # config/locales/en.json
2 |
3 | This file is where English locale settings are stored.
4 |
5 |
6 |
--------------------------------------------------------------------------------
/docs/anatomy/config/locales/es.json.md:
--------------------------------------------------------------------------------
1 | # config/locales/es.json
2 |
3 | This file is where Spanish locale settings are stored.
4 |
5 |
6 |
--------------------------------------------------------------------------------
/docs/anatomy/config/locales/fr.json.md:
--------------------------------------------------------------------------------
1 | # config/locales/fr.json
2 |
3 | This file is where French locale settings are stored.
4 |
5 |
6 |
--------------------------------------------------------------------------------
/docs/anatomy/config/locales/locales.md:
--------------------------------------------------------------------------------
1 | # config/locales
2 |
3 | This folder contains the information that is used by your app in supporting visiting client's different [locales](http://en.wikipedia.org/wiki/Locale).
4 |
5 | ### Usage
6 |
7 | See **[Concepts > Internationalization](https://sailsjs.com/documentation/concepts/internationalization)**.
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/docs/anatomy/config/log.js.md:
--------------------------------------------------------------------------------
1 | # config/log.js
2 |
3 | This file contains the logger configuration for your Sails app.
4 |
5 | Configure the log level for your app, as well as the transport.
6 |
7 | Underneath the covers, Sails uses Winston for logging, which allows for some pretty neat custom transports/adapters for log messages.
8 |
9 | ### Usage
10 |
11 | See [`sails.config.log`](https://sailsjs.com/documentation/reference/configuration/sails-config-log) for all available options.
12 |
13 |
14 |
--------------------------------------------------------------------------------
/docs/anatomy/config/models.js.md:
--------------------------------------------------------------------------------
1 | # config/models.js
2 |
3 | Unless you override them, the properties contained in this file will be included in each of your models.
4 |
5 | ### Usage
6 |
7 | See [`sails.config.models`](https://sailsjs.com/documentation/reference/configuration/sails-config-models) for all available options.
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/docs/anatomy/config/policies.js.md:
--------------------------------------------------------------------------------
1 | # config/policies.js
2 |
3 | This file contains the default policies for your app.
4 |
5 | Policies are simply Express middleware functions which run before your controllers. You can apply one or more policies to a given controller, or protect just one of it's actions. Any policy file (e.g. `api/policies/isLoggedIn.js`) can be dropped into the `api/policies/` folder, at which point it can be accessed by it's filename, minus the extension, (e.g. `isLoggedIn`).
6 |
7 | ### Usage
8 |
9 | See [`sails.config.policies`](https://sailsjs.com/documentation/reference/configuration/sails-config-policies) for all available options.
10 |
11 |
12 |
--------------------------------------------------------------------------------
/docs/anatomy/config/routes.js.md:
--------------------------------------------------------------------------------
1 | # config/routes.js
2 |
3 | This file contains custom routes. Sails uses these routes to determine what to do each time it receives a request.
4 |
5 | If Sails receives a URL that doesn't match any of the [custom routes](https://sailsjs.com/documentation/concepts/routes/custom-routes) in this file, it will check for matching [assets](https://sailsjs.com/documentation/concepts/assets) (images, scripts, stylesheets, etc.). Finally, if those don't match either, the [default 404 handler](https://sailsjs.com/documentation/reference/response-res/res-not-found) is triggered.
6 |
7 | When you first generate your Sails app, there is only one route in this file. Its job is to serve the home page.
8 |
9 | You'll probably want to add some more.
10 |
11 | > Sails also injects _shadow routes_, or implicit routes that handle certain kinds of requests behind the scenes. For more information about these kinds of routes, see **[Concepts > Blueprints](https://sailsjs.com/documentation/concepts/blueprints)**.
12 |
13 | ### Usage
14 |
15 | See [`sails.config.routes`](https://sailsjs.com/documentation/reference/configuration/sails-config-routes) for all available options.
16 |
17 |
18 |
--------------------------------------------------------------------------------
/docs/anatomy/config/security.js.md:
--------------------------------------------------------------------------------
1 | # config/security.js
2 |
3 | This file is the conventional home of your Sails app's global security settings. For a complete reference of available security configuration in Sails, see:
4 |
5 | * CORS settings reference: [sails.config.security.cors](https://sailsjs.com/documentation/reference/configuration/sails-config-security-cors)
6 | * CSRF settings reference: [sails.config.security.csrf](https://sailsjs.com/documentation/reference/configuration/sails-config-security-csrf)
7 |
8 | For a conceptual explanation of CORS in Sails, see [Security > CORS](https://sailsjs.com/documentation/concepts/security/cors).
9 |
10 | For a conceptual explanation of CSRF in Sails, see [Security > CSRF](https://sailsjs.com/documentation/concepts/security/csrf).
11 |
12 | ### Usage
13 |
14 | See [`sails.config.security`](https://sailsjs.com/documentation/reference/configuration/sails-config-security) for all available options.
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/docs/anatomy/config/session.js.md:
--------------------------------------------------------------------------------
1 | # config/session.js
2 |
3 | This file contains information that tells Sails where to store your sessions.
4 |
5 | Sails session integration leans heavily on the great work already done by Express, but also unifies socket.io with the Connect session store. It uses Connect's cookie parser to normalize configuration differences between Express and socket.io and hooks into Sails' middleware interpreter to allow you to access and auto-save to `req.session` with Socket.io the same way you would with Express.
6 |
7 | This is where you would go to configure a different session store like Redis or Mongo. In this file you will find commented examples of what that configuration should look like.
8 |
9 | This file also contains your 'Session Secret' that is generated by Sails when you create your app. Do not change or remove this unless you really know what you are doing.
10 |
11 | ### Usage
12 |
13 | See [`sails.config.session`](https://sailsjs.com/documentation/reference/configuration/sails-config-session) for all available options.
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/docs/anatomy/config/sockets.js.md:
--------------------------------------------------------------------------------
1 | # config/sockets.js
2 |
3 | This is a configuration file that allows you to customize the way your app talks to clients over Socket.IO.
4 |
5 | It provides transparent access to Sails' encapsulated pubsub/socket server for complete customizability. In it you can do things on the list below (and more!).
6 |
7 | - Override afterDisconnect function (server side)
8 | - Define custom authorization logic for client socket connections
9 | - Set transport method
10 | - Change Heartbeat Interval
11 | - Change socket store
12 |
13 | ### More Info
14 | > Socket.IO configuration options can be found [here](https://github.com/LearnBoost/Socket.IO/wiki/Configuring-Socket.IO).
15 |
16 | ### Usage
17 |
18 | See [`sails.config.sockets`](https://sailsjs.com/documentation/reference/configuration/sails-config-sockets) for all available options.
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/docs/anatomy/config/views.js.md:
--------------------------------------------------------------------------------
1 | # config/views.js
2 |
3 | This file is where Sails looks to find out which templating engine to use when rendering server side HTML templates. By default Sails uses ejs, but any view engine can be used by changing the `extension` and supplying a `getRenderFn` value (see the [view engine documentation](https://sailsjs.com/documentation/concepts/views/view-engines) for more info).
4 |
5 | ### Usage
6 |
7 | See [`sails.config.views`](https://sailsjs.com/documentation/reference/configuration/sails-config-views) for all available options.
8 |
9 |
10 |
--------------------------------------------------------------------------------
/docs/anatomy/gitignore.md:
--------------------------------------------------------------------------------
1 | # .gitignore
2 |
3 | This file is only relevant if you are using git.
4 |
5 | It informs `git` of any files that you don't want `pushed` to the remote server.
6 |
7 | Files which match the splat patterns seen in the code below will be ignored by git. This keeps random crap and and sensitive credentials from being uploaded to your repository. It allows you to configure your app for your machine without accidentally committing settings which will smash the local settings of other developers on your team.
8 |
9 | Some reasonable defaults are included, but, of course, you should modify/extend/prune to fit your needs!
10 |
11 | [Read more about .gitignore](https://help.github.com/articles/ignoring-files)
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/docs/anatomy/package.json.md:
--------------------------------------------------------------------------------
1 | # package.json
2 |
3 | This is a standard configuration file for [npm](https://npmjs.org/doc/json.html). Among other things, this file contains the name and version of all of the Node Modules that your app depends on to run. You can change this manually but be careful to adhere to their rules or things might break.
4 |
5 |
6 |
--------------------------------------------------------------------------------
/docs/anatomy/sailsrc.md:
--------------------------------------------------------------------------------
1 | # .sailsrc
2 |
3 | This file is useful for setting configuration for ALL Sails apps on a computer. You can also use it to extend the functionality of the Sails CLI tool.
4 |
5 | You can learn more about using sailsrc files [here](https://sailsjs.com/documentation/concepts/configuration/using-sailsrc-files).
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/docs/anatomy/tasks/config/babel.js.md:
--------------------------------------------------------------------------------
1 | # tasks/config/babel.js
2 |
3 | This file configures a Grunt task called "babel".
4 |
5 | This task is used to transpile any ES8, ES7, and ES6 syntax in your front-end JavaScript files for compatibility with older browsers.
6 |
7 | > (By default, only `.js` files in the `assets/js/` folder and subfolders will be transpiled. If you need other things transpiled, such as `assets/dependencies/`, you'll need to modify the configuration of this task accordingly.)
8 |
9 | For additional usage documentation, see [`grunt-babel`](https://npmjs.com/package/grunt-babel).
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/docs/anatomy/tasks/config/clean.js.md:
--------------------------------------------------------------------------------
1 | # tasks/config/clean.js
2 |
3 | This file configures a Grunt task called "clean".
4 |
5 | This task is used when preparing for a new pass through the asset pipeline. Its job is to remove any existing temporary files and folders in your Sails app's web root.
6 |
7 | > (By default, the [web root in a Sails app](https://sailsjs.com/documentation/concepts/assets) is a hidden directory called `.tmp/public`.)
8 |
9 | For additional usage documentation, see [`grunt-contrib-clean`](https://npmjs.com/package/grunt-contrib-clean).
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/docs/anatomy/tasks/config/coffee.js.md:
--------------------------------------------------------------------------------
1 | # tasks/config/coffee.js
2 |
3 | This file configures a Grunt task called "coffee".
4 |
5 | By default, this compiles CoffeeScript files located in [`assets/js/`](https://sailsjs.com/anatomy/assets/js/) into JavaScript, then generates new `.js` files in `.tmp/public/js/`.
6 |
7 |
8 | ### But I'm not using CoffeeScript...
9 |
10 | No problem!
11 |
12 | If you aren't using any kind of pre-processing for your client-side JavaScript, then just ignore this file.
13 |
14 | If you want to use a _different_ pre-processor like [TypeScript](https://www.typescriptlang.org/) or [Babel](https://babeljs.io/), and you want Sails to process your client-side JavaScript assets automatically as you work, then you're in luck. In most cases, this is as easy as installing the appropriate Grunt plugin as a dependency of your Sails app, and then configuring it to output compiled JavaScript to the same path as in this default task.
15 |
16 | Here are a couple of popular examples:
17 |
18 | + [grunt-ts](https://www.npmjs.com/package/grunt-ts)
19 | + [grunt-babel](https://www.npmjs.com/package/grunt-babel)
20 |
21 |
22 | ### Usage
23 |
24 | For additional usage documentation, see [`grunt-contrib-coffee`](https://npmjs.com/package/grunt-contrib-coffee).
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/docs/anatomy/tasks/config/concat.js.md:
--------------------------------------------------------------------------------
1 | # tasks/config/concat.js
2 |
3 | This file configures a Grunt task called "concat".
4 |
5 | It concatenates the contents of multiple JavaScript and/or CSS files into two new files, each located at `concat/production.js` and `concat/production.css` respectively in `.tmp/public/concat`.
6 |
7 | This is used as an intermediate step to generate monolithic files that can then be passed in to `uglify` and/or `cssmin` for [minification](https://en.wikipedia.org/wiki/Minification_(programming)).
8 |
9 |
10 | ### Usage
11 |
12 | For additional usage documentation, see [`grunt-contrib-concat`](https://npmjs.com/package/grunt-contrib-concat).
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/docs/anatomy/tasks/config/config.md:
--------------------------------------------------------------------------------
1 | # tasks/config/
2 |
3 | This folder contains the default Grunt task configuration used by the main entry points in [`tasks/register/`](https://sailsjs.com/anatomy/tasks/register).
4 |
5 | For more about the files in this folder, see [Assets > Default Tasks](https://sailsjs.com/documentation/concepts/assets/default-tasks).
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/docs/anatomy/tasks/config/copy.js.md:
--------------------------------------------------------------------------------
1 | # tasks/config/copy.js
2 |
3 | This file configures a Grunt task called "copy".
4 |
5 | Copy files and/or folders from your `assets/` directory into the web root (`.tmp/public`) so they can be served via HTTP, and also for further pre-processing by other Grunt tasks.
6 |
7 | ##### Normal usage (`sails lift`)
8 | Copies all directories and files (except CoffeeScript and LESS) from the `assets/` folder into the web root -- conventionally a hidden directory located `.tmp/public`.
9 |
10 | ##### Via the `build` tasklist (`sails www`)
11 | Copies all directories and files from the .tmp/public directory into a www directory.
12 |
13 | ### Usage
14 |
15 | For additional usage documentation, see [`grunt-contrib-copy`](https://npmjs.com/package/grunt-contrib-copy).
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/docs/anatomy/tasks/config/cssmin.js.md:
--------------------------------------------------------------------------------
1 | # tasks/config/cssmin.js
2 |
3 | This file configures a Grunt task called "cssmin".
4 |
5 | It minifies the intermediate, concatenated CSS stylesheet which was prepared by the `concat` task at `.tmp/public/concat/production.css`. Together with the `concat` task, this is the final step that minifies all CSS files from `assets/styles/` (and potentially your LESS importer file from `assets/styles/importer.less`).
6 |
7 | ### Usage
8 |
9 | For additional usage documentation, see [`grunt-contrib-cssmin`](https://npmjs.com/package/grunt-contrib-cssmin).
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/docs/anatomy/tasks/config/hash.js.md:
--------------------------------------------------------------------------------
1 | # tasks/config/hash.js
2 |
3 |
4 | This file configures a Grunt task called "hash".
5 |
6 | This task implements cache-busting for minified CSS and JavaScript files.
7 |
8 | Specifically, its job is to append a unique hash to the end of a filename.
9 |
10 | > For example: bar/foo.css => bar/dist/foo.f8494f81.css
11 |
12 |
13 | ### Usage
14 |
15 | For additional usage documentation, see [`grunt-hash`](https://github.com/jgallen23/grunt-hash/tree/0.5.0#grunt-hash).
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/docs/anatomy/tasks/config/less.js.md:
--------------------------------------------------------------------------------
1 | # tasks/config/less.js
2 |
3 |
4 | This file configures a Grunt task called "less".
5 |
6 | Its job is to compile your LESS files into a CSS stylesheet.
7 |
8 | By default, only the `assets/styles/importer.less` file is compiled. This allows you to control the ordering yourself, i.e. import your dependencies, mixins, variables, resets, etc. before your other more application-specific styles. This is entirely up to you, and based on the order with which write your `@import`s in your LESS file.
9 |
10 | ### But I'm not using LESS...
11 |
12 | No problem!
13 |
14 | If you aren't using _any_ preprocessor for your stylesheets, then just ignore this file.
15 |
16 | If you want to use a different pre-processor like [SASS](http://sass-lang.com/) or [Stylus](http://stylus-lang.com/), and you want Sails to process your stylesheets automatically as you work, then you're in luck. In most cases, this is as easy as installing the appropriate Grunt plugin as a dependency of your Sails app, and then configuring it to output compiled CSS to the same path as in this default task.
17 |
18 | Here are a couple of popular examples:
19 |
20 | + [grunt-sass](http://npmjs.com/package/grunt-sass)
21 | + [grunt-contrib-stylus](https://npmjs.com/package/grunt-contrib-stylus)
22 |
23 | ### Usage
24 |
25 | For additional usage documentation, see [`grunt-contrib-less`](https://npmjs.com/package/grunt-contrib-less).
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/docs/anatomy/tasks/config/sync.js.md:
--------------------------------------------------------------------------------
1 | # tasks/config/sync.js
2 |
3 |
4 | This file configures a Grunt task called "sync".
5 |
6 | This task synchronizes one directory with another (like rsync). In the default Sails asset pipeline, it plays a very similar role to `tasks/config/copy.js`, but copies only those files that have actually changed since the last time the task was run.
7 |
8 | Specifically, its job is to synchronize files from the `assets/` folder to `.tmp/public`, smashing anything that's already there.
9 |
10 |
11 | ### Usage
12 |
13 | For additional usage documentation, see [`grunt-sync`](https://www.npmjs.com/package/grunt-sync).
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/docs/anatomy/tasks/config/uglify.js.md:
--------------------------------------------------------------------------------
1 | # tasks/config/uglify.js
2 |
3 | This file configures a Grunt task called "uglify".
4 |
5 | Its job is to minify client-side JavaScript files. Internally, it uses [UglifyES](https://www.npmjs.com/package/uglifyes).
6 |
7 | ### Usage
8 |
9 | For additional usage documentation, see [`grunt-contrib-uglify`](https://github.com/gruntjs/grunt-contrib-uglify/tree/harmony).
10 |
11 | ### ES8 and beyond
12 |
13 | The default package is capable of minifying JavaScript written using ES6, ES7, and ES8 syntax and features, even without [transpiling](https://sailsjs.com/documentation/concepts/assets/default-tasks#?babel). However, if you're planning on supporting older browsers that don't support ES6, it's recommended that you still transpile your code (by leaving the default [`babel`](https://sailsjs.com/documentation/anatomy/tasks/config/babel.js) and [`polyfill`](https://sailsjs.com/documentation/anatomy/tasks/register/polyfill.js) tasks in place).
14 |
15 |
16 |
--------------------------------------------------------------------------------
/docs/anatomy/tasks/config/watch.js.md:
--------------------------------------------------------------------------------
1 | # tasks/config/watch.js
2 |
3 | This file configures a Grunt task called "watch".
4 |
5 | It runs predefined tasks whenever watched file patterns are added, changed or deleted.
6 |
7 | Specifically, this watches for changes to:
8 | - files in the `assets` folder
9 | - the `tasks/pipeline.js` file
10 |
11 | ...and then re-runs the appropriate tasks.
12 |
13 | ### Usage
14 |
15 | For additional usage documentation, see [`grunt-contrib-watch`](https://npmjs.com/package/grunt-contrib-watch).
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/docs/anatomy/tasks/pipeline.js.md:
--------------------------------------------------------------------------------
1 | # tasks/pipeline.js
2 |
3 | The `pipeline.js` file in your Sails app determines the order in which your stylesheets,
4 | JavaScript, and client-side template files should be compiled and linked as `