mirror of
https://github.com/plankanban/planka.git
synced 2025-07-18 20:59:44 +02:00
Code formatting with prettier, change eslint config for the server
This commit is contained in:
parent
bc87c1d883
commit
7a3805e64c
191 changed files with 4321 additions and 2880 deletions
|
@ -10,28 +10,23 @@
|
|||
*/
|
||||
|
||||
module.exports.blueprints = {
|
||||
/***************************************************************************
|
||||
* *
|
||||
* Automatically expose implicit routes for every action in your app? *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
/**
|
||||
*
|
||||
* Automatically expose implicit routes for every action in your app?
|
||||
*
|
||||
*/
|
||||
// actions: false,
|
||||
|
||||
/***************************************************************************
|
||||
* *
|
||||
* Automatically expose RESTful routes for your models? *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
/**
|
||||
*
|
||||
* Automatically expose RESTful routes for your models?
|
||||
*
|
||||
*/
|
||||
// rest: true,
|
||||
|
||||
/***************************************************************************
|
||||
* *
|
||||
* Automatically expose CRUD "shortcut" routes to GET requests? *
|
||||
* (These are enabled by default in development only.) *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
/**
|
||||
*
|
||||
* Automatically expose CRUD "shortcut" routes to GET requests?
|
||||
* (These are enabled by default in development only.)
|
||||
*
|
||||
*/
|
||||
// shortcuts: true,
|
||||
};
|
||||
|
|
2
server/config/bootstrap.js
vendored
2
server/config/bootstrap.js
vendored
|
@ -9,7 +9,7 @@
|
|||
* https://sailsjs.com/config/bootstrap
|
||||
*/
|
||||
|
||||
module.exports.bootstrap = async function() {
|
||||
module.exports.bootstrap = async () => {
|
||||
// By convention, this is a good place to set up fake data during development.
|
||||
//
|
||||
// For example:
|
||||
|
|
|
@ -12,11 +12,11 @@ const path = require('path');
|
|||
const sails = require('sails');
|
||||
|
||||
module.exports.custom = {
|
||||
/***************************************************************************
|
||||
* *
|
||||
* Any other custom config this Sails app should use during development. *
|
||||
* *
|
||||
***************************************************************************/
|
||||
/**
|
||||
*
|
||||
* Any other custom config this Sails app should use during development.
|
||||
*
|
||||
*/
|
||||
|
||||
baseUrl: process.env.BASE_URL,
|
||||
|
||||
|
|
|
@ -14,37 +14,37 @@
|
|||
*/
|
||||
|
||||
module.exports.datastores = {
|
||||
/***************************************************************************
|
||||
* *
|
||||
* Your app's default datastore. *
|
||||
* *
|
||||
* Sails apps read and write to local disk by default, using a built-in *
|
||||
* database adapter called `sails-disk`. This feature is purely for *
|
||||
* convenience during development; since `sails-disk` is not designed for *
|
||||
* use in a production environment. *
|
||||
* *
|
||||
* To use a different db _in development_, follow the directions below. *
|
||||
* Otherwise, just leave the default datastore as-is, with no `adapter`. *
|
||||
* *
|
||||
* (For production configuration, see `config/env/production.js`.) *
|
||||
* *
|
||||
***************************************************************************/
|
||||
/**
|
||||
*
|
||||
* Your app's default datastore.
|
||||
*
|
||||
* Sails apps read and write to local disk by default, using a built-in
|
||||
* database adapter called `sails-disk`. This feature is purely for
|
||||
* convenience during development; since `sails-disk` is not designed for
|
||||
* use in a production environment.
|
||||
*
|
||||
* To use a different db _in development_, follow the directions below.
|
||||
* Otherwise, just leave the default datastore as-is, with no `adapter`.
|
||||
*
|
||||
* (For production configuration, see `config/env/production.js`.)
|
||||
*
|
||||
*/
|
||||
|
||||
default: {
|
||||
/***************************************************************************
|
||||
* *
|
||||
* Want to use a different database during development? *
|
||||
* *
|
||||
* 1. Choose an adapter: *
|
||||
* https://sailsjs.com/plugins/databases *
|
||||
* *
|
||||
* 2. Install it as a dependency of your Sails app. *
|
||||
* (For example: npm install sails-mysql --save) *
|
||||
* *
|
||||
* 3. Then pass it in, along with a connection URL. *
|
||||
* (See https://sailsjs.com/config/datastores for help.) *
|
||||
* *
|
||||
***************************************************************************/
|
||||
/**
|
||||
*
|
||||
* Want to use a different database during development?
|
||||
*
|
||||
* 1. Choose an adapter:
|
||||
* https://sailsjs.com/plugins/databases
|
||||
*
|
||||
* 2. Install it as a dependency of your Sails app.
|
||||
* (For example: npm install sails-mysql --save)
|
||||
*
|
||||
* 3. Then pass it in, along with a connection URL.
|
||||
* (See https://sailsjs.com/config/datastores for help.)
|
||||
*
|
||||
*/
|
||||
|
||||
adapter: 'sails-postgresql',
|
||||
url: process.env.DATABASE_URL,
|
||||
|
|
497
server/config/env/production.js
vendored
497
server/config/env/production.js
vendored
|
@ -24,129 +24,116 @@ const path = require('path');
|
|||
const sails = require('sails');
|
||||
|
||||
module.exports = {
|
||||
/**************************************************************************
|
||||
* *
|
||||
* Tell Sails what database(s) it should use in production. *
|
||||
* *
|
||||
* (https://sailsjs.com/config/datastores) *
|
||||
* *
|
||||
**************************************************************************/
|
||||
/**
|
||||
*
|
||||
* Tell Sails what database(s) it should use in production.
|
||||
*
|
||||
* (https://sailsjs.com/config/datastores)
|
||||
*
|
||||
*/
|
||||
|
||||
datastores: {
|
||||
/***************************************************************************
|
||||
* *
|
||||
* Configure your default production database. *
|
||||
* *
|
||||
* 1. Choose an adapter: *
|
||||
* https://sailsjs.com/plugins/databases *
|
||||
* *
|
||||
* 2. Install it as a dependency of your Sails app. *
|
||||
* (For example: npm install sails-mysql --save) *
|
||||
* *
|
||||
* 3. Then set it here (`adapter`), along with a connection URL (`url`) *
|
||||
* and any other, adapter-specific customizations. *
|
||||
* (See https://sailsjs.com/config/datastores for help.) *
|
||||
* *
|
||||
***************************************************************************/
|
||||
/**
|
||||
*
|
||||
* Configure your default production database.
|
||||
*
|
||||
* 1. Choose an adapter:
|
||||
* https://sailsjs.com/plugins/databases
|
||||
*
|
||||
* 2. Install it as a dependency of your Sails app.
|
||||
* (For example: npm install sails-mysql --save)
|
||||
*
|
||||
* 3. Then set it here (`adapter`), along with a connection URL (`url`)
|
||||
* and any other, adapter-specific customizations.
|
||||
* (See https://sailsjs.com/config/datastores for help.)
|
||||
*
|
||||
*/
|
||||
|
||||
default: {
|
||||
adapter: 'sails-postgresql',
|
||||
url: process.env.DATABASE_URL,
|
||||
|
||||
// adapter: 'sails-mysql',
|
||||
// url: 'mysql://user:password@host:port/database',
|
||||
//--------------------------------------------------------------------------
|
||||
// /\ To avoid checking it in to version control, you might opt to set
|
||||
// || sensitive credentials like `url` using an environment variable.
|
||||
//
|
||||
// For example:
|
||||
// ```
|
||||
// sails_datastores__default__url=mysql://admin:myc00lpAssw2D@db.example.com:3306/my_prod_db
|
||||
// ```
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
/****************************************************************************
|
||||
* *
|
||||
* More adapter-specific options *
|
||||
* *
|
||||
* > For example, for some hosted PostgreSQL providers (like Heroku), the *
|
||||
* > extra `ssl: true` option is mandatory and must be provided. *
|
||||
* *
|
||||
* More info: *
|
||||
* https://sailsjs.com/config/datastores *
|
||||
* *
|
||||
****************************************************************************/
|
||||
/**
|
||||
*
|
||||
* More adapter-specific options
|
||||
*
|
||||
* > For example, for some hosted PostgreSQL providers (like Heroku), the
|
||||
* > extra `ssl: true` option is mandatory and must be provided.
|
||||
*
|
||||
* More info:
|
||||
* https://sailsjs.com/config/datastores
|
||||
*
|
||||
*/
|
||||
|
||||
// ssl: true,
|
||||
},
|
||||
},
|
||||
|
||||
models: {
|
||||
/***************************************************************************
|
||||
* *
|
||||
* To help avoid accidents, Sails automatically sets the automigration *
|
||||
* strategy to "safe" when your app lifts in production mode. *
|
||||
* (This is just here as a reminder.) *
|
||||
* *
|
||||
* More info: *
|
||||
* https://sailsjs.com/docs/concepts/models-and-orm/model-settings#?migrate *
|
||||
* *
|
||||
***************************************************************************/
|
||||
/**
|
||||
*
|
||||
* To help avoid accidents, Sails automatically sets the automigration
|
||||
* strategy to "safe" when your app lifts in production mode.
|
||||
* (This is just here as a reminder.)
|
||||
*
|
||||
* More info:
|
||||
* https://sailsjs.com/docs/concepts/models-and-orm/model-settings#?migrate
|
||||
*
|
||||
*/
|
||||
|
||||
migrate: 'safe',
|
||||
|
||||
/***************************************************************************
|
||||
* *
|
||||
* If, in production, this app has access to physical-layer CASCADE *
|
||||
* constraints (e.g. PostgreSQL or MySQL), then set those up in the *
|
||||
* database and uncomment this to disable Waterline's `cascadeOnDestroy` *
|
||||
* polyfill. (Otherwise, if you are using a databse like Mongo, you might *
|
||||
* choose to keep this enabled.) *
|
||||
* *
|
||||
***************************************************************************/
|
||||
/**
|
||||
*
|
||||
* If, in production, this app has access to physical-layer CASCADE
|
||||
* constraints (e.g. PostgreSQL or MySQL), then set those up in the
|
||||
* database and uncomment this to disable Waterline's `cascadeOnDestroy`
|
||||
* polyfill. (Otherwise, if you are using a databse like Mongo, you might
|
||||
* choose to keep this enabled.)
|
||||
*
|
||||
*/
|
||||
|
||||
// cascadeOnDestroy: false,
|
||||
},
|
||||
|
||||
/**************************************************************************
|
||||
* *
|
||||
* Always disable "shortcut" blueprint routes. *
|
||||
* *
|
||||
* > You'll also want to disable any other blueprint routes if you are not *
|
||||
* > actually using them (e.g. "actions" and "rest") -- but you can do *
|
||||
* > that in `config/blueprints.js`, since you'll want to disable them in *
|
||||
* > all environments (not just in production.) *
|
||||
* *
|
||||
***************************************************************************/
|
||||
/**
|
||||
* Always disable "shortcut" blueprint routes.
|
||||
*
|
||||
* > You'll also want to disable any other blueprint routes if you are not
|
||||
* > actually using them (e.g. "actions" and "rest") -- but you can do
|
||||
* > that in `config/blueprints.js`, since you'll want to disable them in
|
||||
* > all environments (not just in production.)
|
||||
*
|
||||
*/
|
||||
|
||||
blueprints: {
|
||||
shortcuts: false,
|
||||
},
|
||||
|
||||
/***************************************************************************
|
||||
* *
|
||||
* Configure your security settings for production. *
|
||||
* *
|
||||
* IMPORTANT: *
|
||||
* If web browsers will be communicating with your app, be sure that *
|
||||
* you have CSRF protection enabled. To do that, set `csrf: true` over *
|
||||
* in the `config/security.js` file (not here), so that CSRF app can be *
|
||||
* tested with CSRF protection turned on in development mode too. *
|
||||
* *
|
||||
***************************************************************************/
|
||||
/**
|
||||
*
|
||||
* Configure your security settings for production.
|
||||
*
|
||||
* IMPORTANT:
|
||||
* If web browsers will be communicating with your app, be sure that
|
||||
* you have CSRF protection enabled. To do that, set `csrf: true` over
|
||||
* in the `config/security.js` file (not here), so that CSRF app can be
|
||||
* tested with CSRF protection turned on in development mode too.
|
||||
*
|
||||
*/
|
||||
|
||||
security: {
|
||||
/***************************************************************************
|
||||
* *
|
||||
* If this app has CORS enabled (see `config/security.js`) with the *
|
||||
* `allowCredentials` setting enabled, then you should uncomment the *
|
||||
* `allowOrigins` whitelist below. This sets which "origins" are allowed *
|
||||
* to send cross-domain (CORS) requests to your Sails app. *
|
||||
* *
|
||||
* > Replace "https://example.com" with the URL of your production server. *
|
||||
* > Be sure to use the right protocol! ("http://" vs. "https://") *
|
||||
* *
|
||||
***************************************************************************/
|
||||
/**
|
||||
*
|
||||
* If this app has CORS enabled (see `config/security.js`) with the
|
||||
* `allowCredentials` setting enabled, then you should uncomment the
|
||||
* `allowOrigins` whitelist below. This sets which "origins" are allowed
|
||||
* to send cross-domain (CORS) requests to your Sails app.
|
||||
*
|
||||
* > Replace "https://example.com" with the URL of your production server.
|
||||
* > Be sure to use the right protocol! ("http://" vs. "https://")
|
||||
*
|
||||
*/
|
||||
|
||||
cors: {
|
||||
// allowOrigins: [
|
||||
|
@ -155,230 +142,194 @@ module.exports = {
|
|||
},
|
||||
},
|
||||
|
||||
/***************************************************************************
|
||||
* *
|
||||
* Configure how your app handles sessions in production. *
|
||||
* *
|
||||
* (https://sailsjs.com/config/session) *
|
||||
* *
|
||||
* > If you have disabled the "session" hook, then you can safely remove *
|
||||
* > this section from your `config/env/production.js` file. *
|
||||
* *
|
||||
***************************************************************************/
|
||||
/**
|
||||
*
|
||||
* Configure how your app handles sessions in production.
|
||||
*
|
||||
* (https://sailsjs.com/config/session)
|
||||
*
|
||||
* > If you have disabled the "session" hook, then you can safely remove
|
||||
* > this section from your `config/env/production.js` file.
|
||||
*
|
||||
*/
|
||||
|
||||
session: {
|
||||
/***************************************************************************
|
||||
* *
|
||||
* Production session store configuration. *
|
||||
* *
|
||||
* Uncomment the following lines to finish setting up a package called *
|
||||
* "@sailshq/connect-redis" that will use Redis to handle session data. *
|
||||
* This makes your app more scalable by allowing you to share sessions *
|
||||
* across a cluster of multiple Sails/Node.js servers and/or processes. *
|
||||
* (See http://bit.ly/redis-session-config for more info.) *
|
||||
* *
|
||||
* > While @sailshq/connect-redis is a popular choice for Sails apps, many *
|
||||
* > other compatible packages (like "connect-mongo") are available on NPM. *
|
||||
* > (For a full list, see https://sailsjs.com/plugins/sessions) *
|
||||
* *
|
||||
***************************************************************************/
|
||||
/**
|
||||
*
|
||||
* Production session store configuration.
|
||||
*
|
||||
* Uncomment the following lines to finish setting up a package called
|
||||
* "@sailshq/connect-redis" that will use Redis to handle session data.
|
||||
* This makes your app more scalable by allowing you to share sessions
|
||||
* across a cluster of multiple Sails/Node.js servers and/or processes.
|
||||
* (See http://bit.ly/redis-session-config for more info.)
|
||||
*
|
||||
* > While @sailshq/connect-redis is a popular choice for Sails apps, many
|
||||
* > other compatible packages (like "connect-mongo") are available on NPM.
|
||||
* > (For a full list, see https://sailsjs.com/plugins/sessions)
|
||||
*
|
||||
*/
|
||||
|
||||
// adapter: '@sailshq/connect-redis',
|
||||
// url: 'redis://user:password@localhost:6379/databasenumber',
|
||||
//--------------------------------------------------------------------------
|
||||
// /\ OR, to avoid checking it in to version control, you might opt to
|
||||
// || set sensitive credentials like this using an environment variable.
|
||||
//
|
||||
// For example:
|
||||
// ```
|
||||
// sails_session__url=redis://admin:myc00lpAssw2D@bigsquid.redistogo.com:9562/0
|
||||
// ```
|
||||
//
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
/***************************************************************************
|
||||
* *
|
||||
* Production configuration for the session ID cookie. *
|
||||
* *
|
||||
* Tell browsers (or other user agents) to ensure that session ID cookies *
|
||||
* are always transmitted via HTTPS, and that they expire 24 hours after *
|
||||
* they are set. *
|
||||
* *
|
||||
* Note that with `secure: true` set, session cookies will _not_ be *
|
||||
* transmitted over unsecured (HTTP) connections. Also, for apps behind *
|
||||
* proxies (like Heroku), the `trustProxy` setting under `http` must be *
|
||||
* configured in order for `secure: true` to work. *
|
||||
* *
|
||||
* > While you might want to increase or decrease the `maxAge` or provide *
|
||||
* > other options, you should always set `secure: true` in production *
|
||||
* > if the app is being served over HTTPS. *
|
||||
* *
|
||||
* Read more: *
|
||||
* https://sailsjs.com/config/session#?the-session-id-cookie *
|
||||
* *
|
||||
***************************************************************************/
|
||||
/**
|
||||
*
|
||||
* Production configuration for the session ID cookie.
|
||||
*
|
||||
* Tell browsers (or other user agents) to ensure that session ID cookies
|
||||
* are always transmitted via HTTPS, and that they expire 24 hours after
|
||||
* they are set.
|
||||
*
|
||||
* Note that with `secure: true` set, session cookies will _not_ be
|
||||
* transmitted over unsecured (HTTP) connections. Also, for apps behind
|
||||
* proxies (like Heroku), the `trustProxy` setting under `http` must be
|
||||
* configured in order for `secure: true` to work.
|
||||
*
|
||||
* > While you might want to increase or decrease the `maxAge` or provide
|
||||
* > other options, you should always set `secure: true` in production
|
||||
* > if the app is being served over HTTPS.
|
||||
*
|
||||
* Read more:
|
||||
* https://sailsjs.com/config/session#?the-session-id-cookie
|
||||
*
|
||||
*/
|
||||
|
||||
cookie: {
|
||||
// secure: true,
|
||||
maxAge: 24 * 60 * 60 * 1000, // 24 hours
|
||||
maxAge: 24 * 60 * 60 * 1000, // 24 hours
|
||||
},
|
||||
|
||||
secret: process.env.SECRET_KEY,
|
||||
},
|
||||
|
||||
/**************************************************************************
|
||||
* *
|
||||
* Set up Socket.io for your production environment. *
|
||||
* *
|
||||
* (https://sailsjs.com/config/sockets) *
|
||||
* *
|
||||
* > If you have disabled the "sockets" hook, then you can safely remove *
|
||||
* > this section from your `config/env/production.js` file. *
|
||||
* *
|
||||
***************************************************************************/
|
||||
/**
|
||||
*
|
||||
* Set up Socket.io for your production environment.
|
||||
*
|
||||
* (https://sailsjs.com/config/sockets)
|
||||
*
|
||||
* > If you have disabled the "sockets" hook, then you can safely remove
|
||||
* > this section from your `config/env/production.js` file.
|
||||
*
|
||||
*/
|
||||
|
||||
sockets: {
|
||||
/***************************************************************************
|
||||
* *
|
||||
* Uncomment the `onlyAllowOrigins` whitelist below to configure which *
|
||||
* "origins" are allowed to open socket connections to your Sails app. *
|
||||
* *
|
||||
* > Replace "https://example.com" etc. with the URL(s) of your app. *
|
||||
* > Be sure to use the right protocol! ("http://" vs. "https://") *
|
||||
* *
|
||||
***************************************************************************/
|
||||
/**
|
||||
*
|
||||
* Uncomment the `onlyAllowOrigins` whitelist below to configure which
|
||||
* "origins" are allowed to open socket connections to your Sails app.
|
||||
*
|
||||
* > Replace "https://example.com" etc. with the URL(s) of your app.
|
||||
* > Be sure to use the right protocol! ("http://" vs. "https://")
|
||||
*
|
||||
*/
|
||||
|
||||
onlyAllowOrigins: [
|
||||
new url.URL(process.env.BASE_URL).origin,
|
||||
],
|
||||
onlyAllowOrigins: [new url.URL(process.env.BASE_URL).origin],
|
||||
|
||||
/***************************************************************************
|
||||
* *
|
||||
* If you are deploying a cluster of multiple servers and/or processes, *
|
||||
* then uncomment the following lines. This tells Socket.io about a Redis *
|
||||
* server it can use to help it deliver broadcasted socket messages. *
|
||||
* *
|
||||
* > Be sure a compatible version of @sailshq/socket.io-redis is installed! *
|
||||
* > (See https://sailsjs.com/config/sockets for the latest version info) *
|
||||
* *
|
||||
* (https://sailsjs.com/docs/concepts/deployment/scaling) *
|
||||
* *
|
||||
***************************************************************************/
|
||||
/**
|
||||
*
|
||||
* If you are deploying a cluster of multiple servers and/or processes,
|
||||
* then uncomment the following lines. This tells Socket.io about a Redis
|
||||
* server it can use to help it deliver broadcasted socket messages.
|
||||
*
|
||||
* > Be sure a compatible version of @sailshq/socket.io-redis is installed!
|
||||
* > (See https://sailsjs.com/config/sockets for the latest version info)
|
||||
*
|
||||
* (https://sailsjs.com/docs/concepts/deployment/scaling)
|
||||
*
|
||||
*/
|
||||
|
||||
// adapter: '@sailshq/socket.io-redis',
|
||||
// url: 'redis://user:password@bigsquid.redistogo.com:9562/databasenumber',
|
||||
//--------------------------------------------------------------------------
|
||||
// /\ OR, to avoid checking it in to version control, you might opt to
|
||||
// || set sensitive credentials like this using an environment variable.
|
||||
//
|
||||
// For example:
|
||||
// ```
|
||||
// sails_sockets__url=redis://admin:myc00lpAssw2D@bigsquid.redistogo.com:9562/0
|
||||
// ```
|
||||
//--------------------------------------------------------------------------
|
||||
},
|
||||
|
||||
/**************************************************************************
|
||||
* *
|
||||
* Set the production log level. *
|
||||
* *
|
||||
* (https://sailsjs.com/config/log) *
|
||||
* *
|
||||
***************************************************************************/
|
||||
/**
|
||||
*
|
||||
* Set the production log level.
|
||||
*
|
||||
* (https://sailsjs.com/config/log)
|
||||
*
|
||||
*/
|
||||
|
||||
log: {
|
||||
level: 'debug',
|
||||
},
|
||||
|
||||
http: {
|
||||
/***************************************************************************
|
||||
* *
|
||||
* The number of milliseconds to cache static assets in production. *
|
||||
* (the "max-age" to include in the "Cache-Control" response header) *
|
||||
* *
|
||||
***************************************************************************/
|
||||
/**
|
||||
*
|
||||
* The number of milliseconds to cache static assets in production.
|
||||
* (the "max-age" to include in the "Cache-Control" response header)
|
||||
*
|
||||
*/
|
||||
|
||||
cache: 365.25 * 24 * 60 * 60 * 1000, // One year
|
||||
|
||||
/***************************************************************************
|
||||
* *
|
||||
* Proxy settings *
|
||||
* *
|
||||
* If your app will be deployed behind a proxy/load balancer - for example, *
|
||||
* on a PaaS like Heroku - then uncomment the `trustProxy` setting below. *
|
||||
* This tells Sails/Express how to interpret X-Forwarded headers. *
|
||||
* *
|
||||
* This setting is especially important if you are using secure cookies *
|
||||
* (see the `cookies: secure` setting under `session` above) or if your app *
|
||||
* relies on knowing the original IP address that a request came from. *
|
||||
* *
|
||||
* (https://sailsjs.com/config/http) *
|
||||
* *
|
||||
***************************************************************************/
|
||||
/**
|
||||
*
|
||||
* Proxy settings
|
||||
*
|
||||
* If your app will be deployed behind a proxy/load balancer - for example,
|
||||
* on a PaaS like Heroku - then uncomment the `trustProxy` setting below.
|
||||
* This tells Sails/Express how to interpret X-Forwarded headers.
|
||||
*
|
||||
* This setting is especially important if you are using secure cookies
|
||||
* (see the `cookies: secure` setting under `session` above) or if your app
|
||||
* relies on knowing the original IP address that a request came from.
|
||||
*
|
||||
* (https://sailsjs.com/config/http)
|
||||
*
|
||||
*/
|
||||
|
||||
// trustProxy: true,
|
||||
},
|
||||
|
||||
/**************************************************************************
|
||||
* *
|
||||
* Lift the server on port 80. *
|
||||
* (if deploying behind a proxy, or to a PaaS like Heroku or Deis, you *
|
||||
* probably don't need to set a port here, because it is oftentimes *
|
||||
* handled for you automatically. If you are not sure if you need to set *
|
||||
* this, just try deploying without setting it and see if it works.) *
|
||||
* *
|
||||
***************************************************************************/
|
||||
/**
|
||||
*
|
||||
* Lift the server on port 80.
|
||||
* (if deploying behind a proxy, or to a PaaS like Heroku or Deis, you
|
||||
* probably don't need to set a port here, because it is oftentimes
|
||||
* handled for you automatically. If you are not sure if you need to set
|
||||
* this, just try deploying without setting it and see if it works.)
|
||||
*
|
||||
*/
|
||||
|
||||
// port: 80,
|
||||
|
||||
/**************************************************************************
|
||||
* *
|
||||
* Configure an SSL certificate *
|
||||
* *
|
||||
* For the safety of your users' data, you should use SSL in production. *
|
||||
* ...But in many cases, you may not actually want to set it up _here_. *
|
||||
* *
|
||||
* Normally, this setting is only relevant when running a single-process *
|
||||
* deployment, with no proxy/load balancer in the mix. But if, on the *
|
||||
* other hand, you are using a PaaS like Heroku, you'll want to set up *
|
||||
* SSL in your load balancer settings (usually somewhere in your hosting *
|
||||
* provider's dashboard-- not here.) *
|
||||
* *
|
||||
* > For more information about configuring SSL in Sails, see: *
|
||||
* > https://sailsjs.com/config/*#?sailsconfigssl *
|
||||
* *
|
||||
**************************************************************************/
|
||||
/**
|
||||
*
|
||||
* Configure an SSL certificate
|
||||
*
|
||||
* For the safety of your users' data, you should use SSL in production.
|
||||
* ...But in many cases, you may not actually want to set it up _here_.
|
||||
*
|
||||
* Normally, this setting is only relevant when running a single-process
|
||||
* deployment, with no proxy/load balancer in the mix. But if, on the
|
||||
* other hand, you are using a PaaS like Heroku, you'll want to set up
|
||||
* SSL in your load balancer settings (usually somewhere in your hosting
|
||||
* provider's dashboard-- not here.)
|
||||
*
|
||||
* > For more information about configuring SSL in Sails, see:
|
||||
* > https://sailsjs.com/config/*#?sailsconfigssl
|
||||
*
|
||||
*/
|
||||
|
||||
// ssl: undefined,
|
||||
|
||||
/**************************************************************************
|
||||
* *
|
||||
* Production overrides for any custom settings specific to your app. *
|
||||
* (for example, production credentials for 3rd party APIs like Stripe) *
|
||||
* *
|
||||
* > See config/custom.js for more info on how to configure these options. *
|
||||
* *
|
||||
***************************************************************************/
|
||||
/**
|
||||
*
|
||||
* Production overrides for any custom settings specific to your app.
|
||||
* (for example, production credentials for 3rd party APIs like Stripe)
|
||||
*
|
||||
* > See config/custom.js for more info on how to configure these options.
|
||||
*
|
||||
*/
|
||||
|
||||
custom: {
|
||||
baseUrl: process.env.BASE_URL,
|
||||
|
||||
uploadsPath: path.join(sails.config.paths.public, 'uploads'),
|
||||
uploadsUrl: `${process.env.BASE_URL}/uploads`,
|
||||
|
||||
// mailgunDomain: 'mg.example.com',
|
||||
// mailgunSecret: 'key-prod_fake_bd32301385130a0bafe030c',
|
||||
// stripeSecret: 'sk_prod__fake_Nfgh82401348jaDa3lkZ0d9Hm',
|
||||
//--------------------------------------------------------------------------
|
||||
// /\ OR, to avoid checking them in to version control, you might opt to
|
||||
// || set sensitive credentials like these using environment variables.
|
||||
//
|
||||
// For example:
|
||||
// ```
|
||||
// sails_custom__mailgunDomain=mg.example.com
|
||||
// sails_custom__mailgunSecret=key-prod_fake_bd32301385130a0bafe030c
|
||||
// sails_custom__stripeSecret=sk_prod__fake_Nfgh82401348jaDa3lkZ0d9Hm
|
||||
// ```
|
||||
//--------------------------------------------------------------------------
|
||||
},
|
||||
};
|
||||
|
|
|
@ -10,41 +10,41 @@
|
|||
*/
|
||||
|
||||
module.exports.globals = {
|
||||
/****************************************************************************
|
||||
* *
|
||||
* Whether to expose the locally-installed Lodash as a global variable *
|
||||
* (`_`), making it accessible throughout your app. *
|
||||
* *
|
||||
****************************************************************************/
|
||||
/**
|
||||
*
|
||||
* Whether to expose the locally-installed Lodash as a global variable
|
||||
* (`_`), making it accessible throughout your app.
|
||||
*
|
||||
*/
|
||||
|
||||
_: require('lodash'),
|
||||
_: require('lodash'), // eslint-disable-line global-require
|
||||
|
||||
/****************************************************************************
|
||||
* *
|
||||
* This app was generated without a dependency on the "async" NPM package. *
|
||||
* *
|
||||
* > Don't worry! This is totally unrelated to JavaScript's "async/await". *
|
||||
* > Your code can (and probably should) use `await` as much as possible. *
|
||||
* *
|
||||
****************************************************************************/
|
||||
/**
|
||||
*
|
||||
* This app was generated without a dependency on the "async" NPM package.
|
||||
*
|
||||
* > Don't worry! This is totally unrelated to JavaScript's "async/await".
|
||||
* > Your code can (and probably should) use `await` as much as possible.
|
||||
*
|
||||
*/
|
||||
|
||||
async: false,
|
||||
|
||||
/****************************************************************************
|
||||
* *
|
||||
* Whether to expose each of your app's models as global variables. *
|
||||
* (See the link at the top of this file for more information.) *
|
||||
* *
|
||||
****************************************************************************/
|
||||
/**
|
||||
*
|
||||
* Whether to expose each of your app's models as global variables.
|
||||
* (See the link at the top of this file for more information.)
|
||||
*
|
||||
*/
|
||||
|
||||
models: true,
|
||||
|
||||
/****************************************************************************
|
||||
* *
|
||||
* Whether to expose the Sails app instance as a global variable (`sails`), *
|
||||
* making it accessible throughout your app. *
|
||||
* *
|
||||
****************************************************************************/
|
||||
/**
|
||||
*
|
||||
* Whether to expose the Sails app instance as a global variable (`sails`),
|
||||
* making it accessible throughout your app.
|
||||
*
|
||||
*/
|
||||
|
||||
sails: true,
|
||||
};
|
||||
|
|
|
@ -10,23 +10,22 @@
|
|||
*/
|
||||
|
||||
module.exports.http = {
|
||||
/****************************************************************************
|
||||
* *
|
||||
* Sails/Express middleware to run for every HTTP request. *
|
||||
* (Only applies to HTTP requests -- not virtual WebSocket requests.) *
|
||||
* *
|
||||
* https://sailsjs.com/documentation/concepts/middleware *
|
||||
* *
|
||||
****************************************************************************/
|
||||
/**
|
||||
*
|
||||
* Sails/Express middleware to run for every HTTP request.
|
||||
* (Only applies to HTTP requests -- not virtual WebSocket requests.)
|
||||
*
|
||||
* https://sailsjs.com/documentation/concepts/middleware
|
||||
*
|
||||
*/
|
||||
|
||||
middleware: {
|
||||
/***************************************************************************
|
||||
* *
|
||||
* The order in which middleware should be run for HTTP requests. *
|
||||
* (This Sails app's routes are handled by the "router" middleware below.) *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
/**
|
||||
*
|
||||
* The order in which middleware should be run for HTTP requests.
|
||||
* (This Sails app's routes are handled by the "router" middleware below.)
|
||||
*
|
||||
*/
|
||||
// order: [
|
||||
// 'cookieParser',
|
||||
// 'session',
|
||||
|
@ -37,15 +36,13 @@ module.exports.http = {
|
|||
// 'www',
|
||||
// 'favicon',
|
||||
// ],
|
||||
|
||||
/***************************************************************************
|
||||
* *
|
||||
* The body parser that will handle incoming multipart HTTP requests. *
|
||||
* *
|
||||
* https://sailsjs.com/config/http#?customizing-the-body-parser *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
/**
|
||||
*
|
||||
* The body parser that will handle incoming multipart HTTP requests.
|
||||
*
|
||||
* https://sailsjs.com/config/http#?customizing-the-body-parser
|
||||
*
|
||||
*/
|
||||
// bodyParser: (function _configureBodyParser(){
|
||||
// var skipper = require('skipper');
|
||||
// var middlewareFn = skipper({ strict: true });
|
||||
|
|
|
@ -13,31 +13,31 @@
|
|||
*/
|
||||
|
||||
module.exports.i18n = {
|
||||
/***************************************************************************
|
||||
* *
|
||||
* Which locales are supported? *
|
||||
* *
|
||||
***************************************************************************/
|
||||
/**
|
||||
*
|
||||
* Which locales are supported?
|
||||
*
|
||||
*/
|
||||
|
||||
locales: ['en', 'es', 'fr', 'de'],
|
||||
|
||||
/****************************************************************************
|
||||
* *
|
||||
* What is the default locale for the site? Note that this setting will be *
|
||||
* overridden for any request that sends an "Accept-Language" header (i.e. *
|
||||
* most browsers), but it's still useful if you need to localize the *
|
||||
* response for requests made by non-browser clients (e.g. cURL). *
|
||||
* *
|
||||
****************************************************************************/
|
||||
/**
|
||||
*
|
||||
* What is the default locale for the site? Note that this setting will be
|
||||
* overridden for any request that sends an "Accept-Language" header (i.e.
|
||||
* most browsers), but it's still useful if you need to localize the
|
||||
* response for requests made by non-browser clients (e.g. cURL).
|
||||
*
|
||||
*/
|
||||
|
||||
// defaultLocale: 'en',
|
||||
|
||||
/****************************************************************************
|
||||
* *
|
||||
* Path (relative to app root) of directory to store locale (translation) *
|
||||
* files in. *
|
||||
* *
|
||||
****************************************************************************/
|
||||
/**
|
||||
*
|
||||
* Path (relative to app root) of directory to store locale (translation)
|
||||
* files in.
|
||||
*
|
||||
*/
|
||||
|
||||
// localesDirectory: 'config/locales',
|
||||
};
|
||||
|
|
|
@ -11,17 +11,16 @@
|
|||
*/
|
||||
|
||||
module.exports.log = {
|
||||
/***************************************************************************
|
||||
* *
|
||||
* Valid `level` configs: i.e. the minimum log level to capture with *
|
||||
* sails.log.*() *
|
||||
* *
|
||||
* The order of precedence for log levels from lowest to highest is: *
|
||||
* silly, verbose, info, debug, warn, error *
|
||||
* *
|
||||
* You may also set the level to "silent" to suppress all logs. *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
/**
|
||||
*
|
||||
* Valid `level` configs: i.e. the minimum log level to capture with
|
||||
* sails.log.*()
|
||||
*
|
||||
* The order of precedence for log levels from lowest to highest is:
|
||||
* silly, verbose, info, debug, warn, error
|
||||
*
|
||||
* You may also set the level to "silent" to suppress all logs.
|
||||
*
|
||||
*/
|
||||
// level: 'info',
|
||||
};
|
||||
|
|
|
@ -14,55 +14,55 @@
|
|||
*/
|
||||
|
||||
module.exports.models = {
|
||||
/***************************************************************************
|
||||
* *
|
||||
* Whether model methods like `.create()` and `.update()` should ignore *
|
||||
* (and refuse to persist) unrecognized data-- i.e. properties other than *
|
||||
* those explicitly defined by attributes in the model definition. *
|
||||
* *
|
||||
* To ease future maintenance of your code base, it is usually a good idea *
|
||||
* to set this to `true`. *
|
||||
* *
|
||||
* > Note that `schema: false` is not supported by every database. *
|
||||
* > For example, if you are using a SQL database, then relevant models *
|
||||
* > are always effectively `schema: true`. And if no `schema` setting is *
|
||||
* > provided whatsoever, the behavior is left up to the database adapter. *
|
||||
* > *
|
||||
* > For more info, see: *
|
||||
* > https://sailsjs.com/docs/concepts/orm/model-settings#?schema *
|
||||
* *
|
||||
***************************************************************************/
|
||||
/**
|
||||
*
|
||||
* Whether model methods like `.create()` and `.update()` should ignore
|
||||
* (and refuse to persist) unrecognized data-- i.e. properties other than
|
||||
* those explicitly defined by attributes in the model definition.
|
||||
*
|
||||
* To ease future maintenance of your code base, it is usually a good idea
|
||||
* to set this to `true`.
|
||||
*
|
||||
* > Note that `schema: false` is not supported by every database.
|
||||
* > For example, if you are using a SQL database, then relevant models
|
||||
* > are always effectively `schema: true`. And if no `schema` setting is
|
||||
* > provided whatsoever, the behavior is left up to the database adapter.
|
||||
* >
|
||||
* > For more info, see:
|
||||
* > https://sailsjs.com/docs/concepts/orm/model-settings#?schema
|
||||
*
|
||||
*/
|
||||
|
||||
// schema: true,
|
||||
|
||||
/***************************************************************************
|
||||
* *
|
||||
* How and whether Sails will attempt to automatically rebuild the *
|
||||
* tables/collections/etc. in your schema. *
|
||||
* *
|
||||
* > Note that, when running in a production environment, this will be *
|
||||
* > automatically set to `migrate: 'safe'`, no matter what you configure *
|
||||
* > here. This is a failsafe to prevent Sails from accidentally running *
|
||||
* > auto-migrations on your production database. *
|
||||
* > *
|
||||
* > For more info, see: *
|
||||
* > https://sailsjs.com/docs/concepts/orm/model-settings#?migrate *
|
||||
* *
|
||||
***************************************************************************/
|
||||
/**
|
||||
*
|
||||
* How and whether Sails will attempt to automatically rebuild the
|
||||
* tables/collections/etc. in your schema.
|
||||
*
|
||||
* > Note that, when running in a production environment, this will be
|
||||
* > automatically set to `migrate: 'safe'`, no matter what you configure
|
||||
* > here. This is a failsafe to prevent Sails from accidentally running
|
||||
* > auto-migrations on your production database.
|
||||
* >
|
||||
* > For more info, see:
|
||||
* > https://sailsjs.com/docs/concepts/orm/model-settings#?migrate
|
||||
*
|
||||
*/
|
||||
|
||||
migrate: 'safe',
|
||||
|
||||
/***************************************************************************
|
||||
* *
|
||||
* Base attributes that are included in all of your models by default. *
|
||||
* By convention, this is your primary key attribute (`id`), as well as two *
|
||||
* other timestamp attributes for tracking when records were last created *
|
||||
* or updated. *
|
||||
* *
|
||||
* > For more info, see: *
|
||||
* > https://sailsjs.com/docs/concepts/orm/model-settings#?attributes *
|
||||
* *
|
||||
***************************************************************************/
|
||||
/**
|
||||
*
|
||||
* Base attributes that are included in all of your models by default.
|
||||
* By convention, this is your primary key attribute (`id`), as well as two
|
||||
* other timestamp attributes for tracking when records were last created
|
||||
* or updated.
|
||||
*
|
||||
* > For more info, see:
|
||||
* > https://sailsjs.com/docs/concepts/orm/model-settings#?attributes
|
||||
*
|
||||
*/
|
||||
|
||||
attributes: {
|
||||
id: {
|
||||
|
@ -77,62 +77,50 @@ module.exports.models = {
|
|||
type: 'ref',
|
||||
columnName: 'updated_at',
|
||||
},
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// /\ Using MongoDB?
|
||||
// || Replace `id` above with this instead:
|
||||
//
|
||||
// ```
|
||||
// id: { type: 'string', columnName: '_id' },
|
||||
// ```
|
||||
//
|
||||
// Plus, don't forget to configure MongoDB as your default datastore:
|
||||
// https://sailsjs.com/docs/tutorials/using-mongo-db
|
||||
//--------------------------------------------------------------------------
|
||||
},
|
||||
|
||||
beforeCreate: function(valuesToSet, proceed) {
|
||||
beforeCreate(valuesToSet, proceed) {
|
||||
valuesToSet.createdAt = new Date().toUTCString();
|
||||
|
||||
proceed();
|
||||
},
|
||||
|
||||
beforeUpdate: function(valuesToSet, proceed) {
|
||||
beforeUpdate(valuesToSet, proceed) {
|
||||
valuesToSet.updatedAt = new Date().toUTCString();
|
||||
|
||||
proceed();
|
||||
},
|
||||
|
||||
/******************************************************************************
|
||||
* *
|
||||
* The set of DEKs (data encryption keys) for at-rest encryption. *
|
||||
* i.e. when encrypting/decrypting data for attributes with `encrypt: true`. *
|
||||
* *
|
||||
* > The `default` DEK is used for all new encryptions, but multiple DEKs *
|
||||
* > can be configured to allow for key rotation. In production, be sure to *
|
||||
* > manage these keys like you would any other sensitive credential. *
|
||||
* *
|
||||
* > For more info, see: *
|
||||
* > https://sailsjs.com/docs/concepts/orm/model-settings#?dataEncryptionKeys *
|
||||
* *
|
||||
******************************************************************************/
|
||||
/**
|
||||
*
|
||||
* The set of DEKs (data encryption keys) for at-rest encryption.
|
||||
* i.e. when encrypting/decrypting data for attributes with `encrypt: true`.
|
||||
*
|
||||
* > The `default` DEK is used for all new encryptions, but multiple DEKs
|
||||
* > can be configured to allow for key rotation. In production, be sure to
|
||||
* > manage these keys like you would any other sensitive credential.
|
||||
*
|
||||
* > For more info, see:
|
||||
* > https://sailsjs.com/docs/concepts/orm/model-settings#?dataEncryptionKeys
|
||||
*
|
||||
*/
|
||||
|
||||
dataEncryptionKeys: {
|
||||
default: 'fKSf/hPekelUegjM7IyM/EhHbd7HI9Kiec5Lxy2t+7w=',
|
||||
},
|
||||
|
||||
/***************************************************************************
|
||||
* *
|
||||
* Whether or not implicit records for associations should be cleaned up *
|
||||
* automatically using the built-in polyfill. This is especially useful *
|
||||
* during development with sails-disk. *
|
||||
* *
|
||||
* Depending on which databases you're using, you may want to disable this *
|
||||
* polyfill in your production environment. *
|
||||
* *
|
||||
* (For production configuration, see `config/env/production.js`.) *
|
||||
* *
|
||||
***************************************************************************/
|
||||
/**
|
||||
*
|
||||
* Whether or not implicit records for associations should be cleaned up
|
||||
* automatically using the built-in polyfill. This is especially useful
|
||||
* during development with sails-disk.
|
||||
*
|
||||
* Depending on which databases you're using, you may want to disable this
|
||||
* polyfill in your production environment.
|
||||
*
|
||||
* (For production configuration, see `config/env/production.js`.)
|
||||
*
|
||||
*/
|
||||
|
||||
// cascadeOnDestroy: true,
|
||||
};
|
||||
|
|
|
@ -9,12 +9,12 @@
|
|||
*/
|
||||
|
||||
module.exports.policies = {
|
||||
/***************************************************************************
|
||||
* *
|
||||
* Default policy for all controllers and actions, unless overridden. *
|
||||
* (`true` allows public access) *
|
||||
* *
|
||||
***************************************************************************/
|
||||
/**
|
||||
*
|
||||
* Default policy for all controllers and actions, unless overridden.
|
||||
* (`true` allows public access)
|
||||
*
|
||||
*/
|
||||
|
||||
'*': 'is-authenticated',
|
||||
|
||||
|
|
|
@ -14,18 +14,18 @@
|
|||
*/
|
||||
|
||||
module.exports.security = {
|
||||
/***************************************************************************
|
||||
* *
|
||||
* CORS is like a more modern version of JSONP-- it allows your application *
|
||||
* to circumvent browsers' same-origin policy, so that the responses from *
|
||||
* your Sails app hosted on one domain (e.g. example.com) can be received *
|
||||
* in the client-side JavaScript code from a page you trust hosted on _some *
|
||||
* other_ domain (e.g. trustedsite.net). *
|
||||
* *
|
||||
* For additional options and more information, see: *
|
||||
* https://sailsjs.com/docs/concepts/security/cors *
|
||||
* *
|
||||
***************************************************************************/
|
||||
/**
|
||||
*
|
||||
* CORS is like a more modern version of JSONP-- it allows your application
|
||||
* to circumvent browsers' same-origin policy, so that the responses from
|
||||
* your Sails app hosted on one domain (e.g. example.com) can be received
|
||||
* in the client-side JavaScript code from a page you trust hosted on _some
|
||||
* other_ domain (e.g. trustedsite.net).
|
||||
*
|
||||
* For additional options and more information, see:
|
||||
* https://sailsjs.com/docs/concepts/security/cors
|
||||
*
|
||||
*/
|
||||
|
||||
cors: {
|
||||
allRoutes: true,
|
||||
|
@ -34,19 +34,19 @@ module.exports.security = {
|
|||
allowCredentials: false,
|
||||
},
|
||||
|
||||
/****************************************************************************
|
||||
* *
|
||||
* By default, Sails' built-in CSRF protection is disabled to facilitate *
|
||||
* rapid development. But be warned! If your Sails app will be accessed by *
|
||||
* web browsers, you should _always_ enable CSRF protection before deploying *
|
||||
* to production. *
|
||||
* *
|
||||
* To enable CSRF protection, set this to `true`. *
|
||||
* *
|
||||
* For more information, see: *
|
||||
* https://sailsjs.com/docs/concepts/security/csrf *
|
||||
* *
|
||||
****************************************************************************/
|
||||
/**
|
||||
*
|
||||
* By default, Sails' built-in CSRF protection is disabled to facilitate
|
||||
* rapid development. But be warned! If your Sails app will be accessed by
|
||||
* web browsers, you should _always_ enable CSRF protection before deploying
|
||||
* to production.
|
||||
*
|
||||
* To enable CSRF protection, set this to `true`.
|
||||
*
|
||||
* For more information, see:
|
||||
* https://sailsjs.com/docs/concepts/security/csrf
|
||||
*
|
||||
*/
|
||||
|
||||
// csrf: false,
|
||||
};
|
||||
|
|
|
@ -10,27 +10,27 @@
|
|||
*/
|
||||
|
||||
module.exports.session = {
|
||||
/***************************************************************************
|
||||
* *
|
||||
* Session secret is automatically generated when your new app is created *
|
||||
* Replace at your own risk in production-- you will invalidate the cookies *
|
||||
* of your users, forcing them to log in again. *
|
||||
* *
|
||||
***************************************************************************/
|
||||
/**
|
||||
*
|
||||
* Session secret is automatically generated when your new app is created
|
||||
* Replace at your own risk in production-- you will invalidate the cookies
|
||||
* of your users, forcing them to log in again.
|
||||
*
|
||||
*/
|
||||
|
||||
secret: '8b5b32787a446caa57c0a5abbb4ed6fe',
|
||||
|
||||
/***************************************************************************
|
||||
* *
|
||||
* Customize when built-in session support will be skipped. *
|
||||
* *
|
||||
* (Useful for performance tuning; particularly to avoid wasting cycles on *
|
||||
* session management when responding to simple requests for static assets, *
|
||||
* like images or stylesheets.) *
|
||||
* *
|
||||
* https://sailsjs.com/config/session *
|
||||
* *
|
||||
***************************************************************************/
|
||||
/**
|
||||
*
|
||||
* Customize when built-in session support will be skipped.
|
||||
*
|
||||
* (Useful for performance tuning; particularly to avoid wasting cycles on
|
||||
* session management when responding to simple requests for static assets,
|
||||
* like images or stylesheets.)
|
||||
*
|
||||
* https://sailsjs.com/config/session
|
||||
*
|
||||
*/
|
||||
|
||||
// isSessionDisabled: function (req){
|
||||
// return !!req.path.match(req._sails.LOOKS_LIKE_ASSET_RX);
|
||||
|
|
|
@ -10,36 +10,33 @@
|
|||
*/
|
||||
|
||||
module.exports.sockets = {
|
||||
/***************************************************************************
|
||||
* *
|
||||
* `transports` *
|
||||
* *
|
||||
* The protocols or "transports" that socket clients are permitted to *
|
||||
* use when connecting and communicating with this Sails application. *
|
||||
* *
|
||||
* > Never change this here without also configuring `io.sails.transports` *
|
||||
* > in your client-side code. If the client and the server are not using *
|
||||
* > the same array of transports, sockets will not work properly. *
|
||||
* > *
|
||||
* > For more info, see: *
|
||||
* > https://sailsjs.com/docs/reference/web-sockets/socket-client *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
/**
|
||||
*
|
||||
* `transports`
|
||||
*
|
||||
* The protocols or "transports" that socket clients are permitted to
|
||||
* use when connecting and communicating with this Sails application.
|
||||
*
|
||||
* > Never change this here without also configuring `io.sails.transports`
|
||||
* > in your client-side code. If the client and the server are not using
|
||||
* > the same array of transports, sockets will not work properly.
|
||||
* >
|
||||
* > For more info, see:
|
||||
* > https://sailsjs.com/docs/reference/web-sockets/socket-client
|
||||
*
|
||||
*/
|
||||
// transports: [ 'websocket' ],
|
||||
|
||||
/***************************************************************************
|
||||
* *
|
||||
* `beforeConnect` *
|
||||
* *
|
||||
* This custom beforeConnect function will be run each time BEFORE a new *
|
||||
* socket is allowed to connect, when the initial socket.io handshake is *
|
||||
* performed with the server. *
|
||||
* *
|
||||
* https://sailsjs.com/config/sockets#?beforeconnect *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
/**
|
||||
*
|
||||
* `beforeConnect`
|
||||
*
|
||||
* This custom beforeConnect function will be run each time BEFORE a new
|
||||
* socket is allowed to connect, when the initial socket.io handshake is
|
||||
* performed with the server.
|
||||
*
|
||||
* https://sailsjs.com/config/sockets#?beforeconnect
|
||||
*
|
||||
*/
|
||||
// beforeConnect: function(handshake, proceed) {
|
||||
//
|
||||
// // `true` allows the socket to connect.
|
||||
|
@ -47,16 +44,14 @@ module.exports.sockets = {
|
|||
// return proceed(undefined, true);
|
||||
//
|
||||
// },
|
||||
|
||||
/***************************************************************************
|
||||
* *
|
||||
* `afterDisconnect` *
|
||||
* *
|
||||
* This custom afterDisconnect function will be run each time a socket *
|
||||
* disconnects *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
/**
|
||||
*
|
||||
* `afterDisconnect`
|
||||
*
|
||||
* This custom afterDisconnect function will be run each time a socket
|
||||
* disconnects
|
||||
*
|
||||
*/
|
||||
// afterDisconnect: function(session, socket, done) {
|
||||
//
|
||||
// // By default: do nothing.
|
||||
|
@ -64,13 +59,11 @@ module.exports.sockets = {
|
|||
// return done();
|
||||
//
|
||||
// },
|
||||
|
||||
/***************************************************************************
|
||||
* *
|
||||
* Whether to expose a 'GET /__getcookie' route that sets an HTTP-only *
|
||||
* session cookie. *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
/**
|
||||
*
|
||||
* Whether to expose a 'GET /__getcookie' route that sets an HTTP-only
|
||||
* session cookie.
|
||||
*
|
||||
*/
|
||||
// grant3rdPartyCookie: true,
|
||||
};
|
||||
|
|
|
@ -15,25 +15,25 @@
|
|||
*/
|
||||
|
||||
module.exports.views = {
|
||||
/***************************************************************************
|
||||
* *
|
||||
* Extension to use for your views. When calling `res.view()` in an action, *
|
||||
* you can leave this extension off. For example, calling *
|
||||
* `res.view('homepage')` will (using default settings) look for a *
|
||||
* `views/homepage.ejs` file. *
|
||||
* *
|
||||
***************************************************************************/
|
||||
/**
|
||||
*
|
||||
* Extension to use for your views. When calling `res.view()` in an action,
|
||||
* you can leave this extension off. For example, calling
|
||||
* `res.view('homepage')` will (using default settings) look for a
|
||||
* `views/homepage.ejs` file.
|
||||
*
|
||||
*/
|
||||
|
||||
extension: 'html',
|
||||
|
||||
/***************************************************************************
|
||||
* *
|
||||
* The path (relative to the views directory, and without extension) to *
|
||||
* the default layout file to use, or `false` to disable layouts entirely. *
|
||||
* *
|
||||
* Note that layouts only work with the built-in EJS view engine! *
|
||||
* *
|
||||
***************************************************************************/
|
||||
/**
|
||||
*
|
||||
* The path (relative to the views directory, and without extension) to
|
||||
* the default layout file to use, or `false` to disable layouts entirely.
|
||||
*
|
||||
* Note that layouts only work with the built-in EJS view engine!
|
||||
*
|
||||
*/
|
||||
|
||||
layout: false,
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue