You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+23-22Lines changed: 23 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,14 +6,22 @@ This is an opinionated base [Sails v1](https://sailsjs.com) application, using [
6
6
7
7
Need help? Want to hire me to build your next app or prototype? You can contact me any time via Gitter: [](https://gitter.im/sails-react-bootstrap-webpack/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
+ Setup so Sails will serve Webpack-built bundles as separate apps (so, a marketing site, and an admin site can live side-by-side).
14
+
+ Includes [react-bootstrap](https://www.npmjs.com/package/react-bootstrap) to make using Bootstrap styles / features with React easier.
15
+
+ Schema validation and enforcement for `PRODUCTION`. This repo is set up for `MySQL`. If you plan to use a different datastore, you will likely want to disable the schema validation and enforcement feature inside [`config/bootstrap.js`](config/bootstrap.js). See [schema validation and enforcement](#schema-validation-and-enforcement) for more info.
16
+
17
+
## Branch Warning
10
18
The `master` branch is experimental, and the [release branch](https://github.com/neonexus/sails-react-bootstrap-webpack/tree/release) (or the [`releases section`](https://github.com/neonexus/sails-react-bootstrap-webpack/releases)) is where one should base their use of this template.
11
19
12
20
`master` is **volatile**, likely to change at any time, for any reason; this includes `git push --force` updates.
13
21
14
22
**FINAL WARNING: DO NOT RELY ON THE MASTER BRANCH!**
15
23
16
-
# v3.0.0 Warning
24
+
##v3.0.0 Warning
17
25
Moving from v5 -> v6 of the [React Router](https://reactrouter.com/) can be a serious undertaking (see [the v5 -> v6 migration guide](https://reactrouter.com/docs/en/v6/upgrading/v5)).
18
26
19
27
If you would like to use v5 of React Router, make sure you are cloning [v2 of this repo](https://github.com/neonexus/sails-react-bootstrap-webpack/tree/v2.0.0).
@@ -28,14 +36,6 @@ If you would like to use v5 of React Router, make sure you are cloning [v2 of th
28
36
29
37
See the [`package.json` for more details](package.json).
+ Setup so Sails will serve Webpack-built bundles as separate apps (so, a marketing site, and an admin site can live side-by-side).
36
-
+ Includes [react-bootstrap](https://www.npmjs.com/package/react-bootstrap) to make using Bootstrap styles / features with React easier.
37
-
+ Schema validation and enforcement for `PRODUCTION`. This repo is set up for `MySQL`. If you plan to use a different datastore, you will likely want to disable the schema validation and enforcement feature inside [`config/bootstrap.js`](config/bootstrap.js). See [schema validation and enforcement](#schema-validation-and-enforcement) for more info.
38
-
39
39
## How to Use
40
40
This repo is not installable via `npm`. Instead, GitHub provides a handy "Use this template" (green) button at the top of this page. That will create a special fork of this repo (so there is a single, init commit, instead of the commit history from this repo).
41
41
@@ -66,18 +66,19 @@ There are a few environment variables that the remote configuration files are se
66
66
67
67
If you DO NOT like this behavior, and would prefer the variables stay the same across your environments, feel free to change them in [`config/env/development.js`](config/env/development.js) and [`config/env/production.js`](config/env/production.js)
68
68
69
-
| DEV Variable | DEV Default | PROD Variable | PROD Default | Description |
| ASSETS_URL | "" (empty string) |**ASSETS_URL**|**"" (empty string)**| Webpack is configured to modify static asset URLs to point to a CDN, like CloudFront. MUST end with a slash " / ", or be empty. |
72
-
| BASE_URL |https://myapi.app|**BASE_URL**|**https://myapi.app**| The address of the Sails instance. |
73
-
| DB_HOST | localhost |**DB_HOSTNAME**|**localhost**| The hostname of the datastore. |
74
-
| DB_USER | root |**DB_USERNAME**|**produser**| Username of the datastore. |
75
-
| DB_PASS | mypass |**DB_PASSWORD**|**prodpass**| Password of the datastore. |
76
-
| DB_NAME | myapp |**DB_NAME**|**prod**| The name of the database inside the datastore. |
77
-
| DB_PORT | 3306 |**DB_PORT**|**3306**| The port number for the datastore. |
78
-
| DB_SSL | true |**DB_SSL**|**true**| If the datastore requires SSL, set this to "true". |
79
-
| SESSION_SECRET | "" (empty string) |**SESSION_SECRET**|**"" (empty string)**| This is used to sign cookies, and SHOULD be set, especially on PRODUCTION environments. |
| ASSETS_URL | "" (empty string) | Webpack is configured to modify static asset URLs to point to a CDN, like CloudFront. MUST end with a slash " / ", or be empty. |
72
+
| BASE_URL |https://myapi.app| The address of the Sails instance. |
73
+
|**DEV:** DB_HOST<br />**PROD:** DB_HOSTNAME | localhost | The hostname of the datastore. |
74
+
|**DEV:** DB_USER<br />**PROD:** DB_USERNAME |**DEV:** root <br /> **PROD:** produser | Username of the datastore. |
75
+
|**DEV:** DB_PASS<br />**PROD:** DB_PASSWORD |**DEV:** mypass <br /> **PROD:** prodpass | Password of the datastore. |
76
+
| DB_NAME |**DEV:** myapp <br /> **PROD:** prod | The name of the database inside the datastore. |
77
+
| DB_PORT | 3306 | The port number for the datastore. |
78
+
| DB_SSL | true | If the datastore requires SSL, set this to "true". |
79
+
| SESSION_SECRET | "" (empty string) | Used to sign cookies, and SHOULD be set, especially on PRODUCTION environments. |
Automatic incoming request logging, is a 2 part process. First, the [`request-logger` hook](api/hooks/request-logger.js) gathers info from the request, and creates a new [`RequestLog` record](api/models/RequestLog.js), making sure to mask anything that may be sensitive, such as passwords. Then, a custom response gathers information from the response, again, scrubbing sensitive data (using the [customToJSON](https://sailsjs.com/documentation/concepts/models-and-orm/model-settings?identity=#customtojson) feature of Sails models) to prevent leaking of password hashes, or anything else that should never be publicly accessible. The [`keepModelsSafe` helper](api/helpers/keep-models-safe.js) and the custom responses (such as [ok](api/responses/ok.js) or [serverError](api/responses/serverError.js)) are responsible for the final leg of request logs.
0 commit comments