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
+15-2Lines changed: 15 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ This is an opinionated base [Sails v1](https://sailsjs.com) application, using W
15
15
## How to Use
16
16
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).
17
17
18
-
Scripts built into [`package.json`](package.json):
18
+
### Scripts built into [`package.json`](package.json):
19
19
20
20
| Command | Description
21
21
|---------------|-------------------
@@ -26,10 +26,22 @@ Scripts built into [`package.json`](package.json):
26
26
|npm run build | Will run `npm run clean`, then will build production-ready files with Webpack in the `.tmp/public` folder.
27
27
|npm run build:dev | Same thing as `npm run build`, except that it will not optimize the files, retaining newlines and empty spaces.
28
28
|npm run clean | Will basically delete everything in the `.tmp` folder.
29
-
|npm run lines | Will count the lines of code in the project, minus `.gitignore`'d files, for funzies. There are currently about **6k** custom lines in this repo (views, controllers, helpers, hooks, etc).
29
+
|npm run lines | Will count the lines of code in the project, minus `.gitignore`'d files, for funzies. There are currently about 6k custom lines in this repo (views, controllers, helpers, hooks, etc).
30
30
|npm run test | Run [Mocha](https://mochajs.org/) tests. Everything starts in the [`test/hooks.js`](test/hooks.js) file.
31
31
|npm run coverage | Runs [NYC](https://www.npmjs.com/package/nyc) coverage reporting of the Mocha tests, which generates HTML in `test/coverage`.
32
32
33
+
### Environment Variables used for remote servers:
34
+
| Variable | Description
35
+
|---------------|----------------------
36
+
| ASSETS_URL | Webpack is configured to modify static asset URLs to point to a CDN, like CloudFront. MUST end with a slash " / ".
37
+
| BASE_URL | The address of the Sails instance.
38
+
| DB_HOST | The hostname of the datastore.
39
+
| DB_USER | Username for the datastore.
40
+
| DB_PASS | Password for the datastore.
41
+
| DB_NAME | The name of the database inside the datastore.
42
+
| DB_PORT | The port number for datastore.
43
+
| DB_SSL | If the datastore requires SSL, set this to "true".
44
+
33
45
## Request Logging
34
46
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