btrz-express-base-web

1.2.1 • Public • Published

Web pipeline

  • This package is not intended to be installed independently, it should be used by a repo created with btrz-cli create-applet command.

  • Another consideration to have is that betterez-app has to be running with a user logged-in, this package depends on the Betterez session, otherwise it will redirect to an access denied page.

What does the web pipeline bring to your application?

Three main functions init, start, up

init

It will give you a new express application, a config and a logger based on a config provided by your application (which will be merged with the base-config of the pipeline)
Also will set common middlewares:

  • session: will connect with the memcached session of the betterez app (req.session)
  • PCI: set all the middlewares for PCI compliance
  • cookies: set the cookie-parser middleware
  • bodyParser: set the body parser middleware
  • gitInformation: set git information, commit sha and abbreviated sha (or take it from GIT_COMMIT env var)
  • dynamicHelpers: set jsApps, cssApps, getVueApp helpers for EJS layout
  • logging: set the logger (console, logentries, depending on environment)
  • viewsEngine: set the EJS views engine
  • healthcheck: set the /healthcheck path on your config's appRoute
  • staticAssets (only dev): set /builds path to serve static files
  • webpack for hmr (only dev): set the hot module reload middleware
  • btrz information middlewares:
    • btrzContext: add base common req.btrzContext
    • checkPermissions: check if the user in the session has permission for the config.appRoute
    • validateJWT: check if the user in the session has a valid JWT
    • vueContext: add base common req.vueContext

start

Set middlewares that should be run at the end and before the server is up.

  • errorView: set the error view

up

Runs the server (not needed in Lambda).

  • cluster: Run the server if running locally.
    If running in a lambda "up" should not executed.
    If running in EC2, "up" can create an application cluster.

NPM commands:

  • btrz-express-base-web build: it will run the webpack build and will create 3 files, one with the application javascript called app.js, one for the css created or required in your Vue app called app.css, and the last one is called styles.css which is the file that you have in your application in the following path app/assets/css/overrides.css.

Readme

Keywords

none

Package Sidebar

Install

npm i btrz-express-base-web

Weekly Downloads

136

Version

1.2.1

License

ISC

Unpacked Size

99.2 kB

Total Files

44

Last publish

Collaborators

  • betterez-support