Skip to content

Commit 158b088

Browse files
committed
Added command chart.
1 parent 9726f0f commit 158b088

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,22 @@ This is an opinionated base [Sails v1](https://sailsjs.com) application, using W
99
+ Setup so Sails will serve Webpack-built bundles as separate apps (so, a marketing site, and an admin site can live side-by-side).
1010
+ Includes [react-bootstrap](https://www.npmjs.com/package/react-bootstrap) to make using Bootstrap styles / features with React easier.
1111

12+
## How to Use
13+
This repo is not installable via `npm`. It should be forked to help kick-start projects.
14+
15+
Scripts built into [`package.json`](package.json):
16+
17+
| Command | Description
18+
|---------------|-------------------
19+
|`npm run start`| Will run both `npm run lift` and `npm run open:client` in parallel.
20+
|`npm run open:client` | Will run the [Webpack Dev Server](https://webpack.js.org/configuration/dev-server/) and open a browser tab / window.
21+
|`npm run lift` | The same thing as `sails lift` or `node app.js`; will "[lift our Sails](https://sailsjs.com/documentation/reference/command-line-interface/sails-lift)" instance.
22+
|`npm run debug` | Alias for `node --inspect app.js`.
23+
|`npm run build` | Will run `npm run clean`, then will build production-ready files with Webpack in the `.tmp/public` folder.
24+
|`npm run build:dev` | Same thing as `npm run build`, except that it will not optimize the files, retaining newlines and empty spaces.
25+
|`npm run clean` | Will basically delete everything in the `.tmp` folder.
26+
|`npm run lines` | Will count the lines of code in the project, minus `.gitignore`'d files, for funzies.
27+
1228
## Request Logging
1329
Automatic incoming request logging, is a 2 part process. First, the [`request-logger` hook](api/hooks/request-logger.js) gathers info from the quest, 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.
1430

config/env/production.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ module.exports = {
2424
logSensitiveData: false, // never log sensitive data in production database
2525

2626
baseUrl: 'https://myapi.app',
27+
assetsUrl: 'https://my-cdn.app/', // must end with /
2728

2829
/**************************************************************************
2930
* *

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
"build:dev:webpack": "webpack --mode development --config config/webpack/dev-build.config.js",
6666
"build:prod": "NODE_ENV=production webpack --mode production --config config/webpack/prod.config.js",
6767
"clean": "rimraf .tmp && mkdirp .tmp/public",
68-
"lift": "sails lift",
68+
"lift": "node app.js",
6969
"debug": "node --inspect app.js",
7070
"lines": "git ls-files --exclude-standard -- ':!:**/*.[pjs][npv]g' ':!:**/*.ai' ':!:.idea' ':!:**/*.eslintrc' ':!:package-lock.json' | xargs wc -l"
7171
},

0 commit comments

Comments
 (0)