6.2.2 • Published 5 years ago

@mantris/appify v6.2.2

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago
       d8888                   d8b  .d888
      d88888                   Y8P d88P"
     d88P888                       888
    d88P 888 88888b.  88888b.  888 888888 888  888
   d88P  888 888 "88b 888 "88b 888 888    888  888
  d88P   888 888  888 888  888 888 888    888  888
 d8888888888 888 d88P 888 d88P 888 888    Y88b 888
d88P     888 88888P"  88888P"  888 888     "Y88888
             888      888                      888
             888      888                 Y8b d88P
             888      888                  "Y88P"

MIT license JavaScript Style Guide NPM latest version Package minziped size NPM total downloads NPM monthly downloads NPM weekly downloads

Appify is a very opinionated Node.js API boilerplate as module shipped with out of the box integration with Sentry and DeepTrace.

Install

npm i @mantris/appify

Usage

// app.js

const appify = require('@mantris/appify')
const connect = require('some-db-lib')

module.exports = appify(async (api, config, environment) => {
  const db = await connect(config.db)

  api.get('/users/:id', (req, res) => {
    res
      .set({ 'x-environment': environment })
      .json(db.users.find(req.params.id))
  })
})
// config.js

const { env } = require('@mantris/appify')

module.exports = (environment) => ({
  db: {
    dbname: `mydb-${environment}`,
    dbhost: env.get('DB_HOST', 'mongo://localhost:27107')
  }
})
appify --debug --pretty-errors --config config.js app.js

Environment variables

SettingVarsTypeDefault value
Your app's version/releaseGIT_RELEASEstringnull
Release commitGIT_COMMITstringnull
DeepTrace's DSNAPPIFY_DEEPTRACE_DSN or DEEPTRACE_DSNstringnull
DeepTrace's agent timeoutAPPIFY_DEEPTRACE_TIMEOUT or DEEPTRACE_TIMEOUTnumber3000
Morgan request logger formatAPPIFY_MORGAN_FORMATstring:method :url :status :: :response-time ms :: :resdeeptrace-id
Sentry's DSNAPPIFY_SENTRY_DSN or SENTRY_DSNstringnull
HTTP Server binding socketAPPIFY_SERVER_BINDING_SOCKETstringundefined
HTTP Server binding IPAPPIFY_SERVER_BINDING_IPstring0.0.0.0
HTTP Server binding portAPPIFY_SERVER_BINDING_PORTnumber3000
Use HTTP X-Forwarded-For IP as user IPAPPIFY_SERVER_SPDY_X_FORWARDED_FORbooleantrue
Send HTTP data as plain textAPPIFY_SERVER_SPDY_PLAINbooleantrue
Enable SSLAPPIFY_SERVER_SPDY_SSLbooleanfalse
Path to SSL keyAPPIFY_SERVER_SSL_KEYstringundefined
Path to SSL certAPPIFY_SERVER_SSL_CERTstringundefined
6.2.2

5 years ago

6.2.1

5 years ago

6.2.0

5 years ago

6.1.6

5 years ago

6.1.5

5 years ago

6.0.1

5 years ago

6.0.0

5 years ago

5.0.9

5 years ago

5.0.8

5 years ago

5.0.7

5 years ago

5.0.5

5 years ago

5.0.4

5 years ago

5.0.3

5 years ago

5.0.2

5 years ago

4.1.0

5 years ago

4.0.0

5 years ago

3.0.2

5 years ago

3.0.1

5 years ago

3.0.0

6 years ago

2.7.1

6 years ago

2.7.0

6 years ago

2.6.0

6 years ago

2.5.0

6 years ago

2.4.0

6 years ago

2.3.0

6 years ago

2.2.0

6 years ago

2.0.4

6 years ago

2.0.3

6 years ago

2.0.2

6 years ago

2.0.1

6 years ago

2.0.0

6 years ago

0.9.8

6 years ago

0.9.7

6 years ago

0.9.6

6 years ago

0.9.5

6 years ago

0.9.4

6 years ago

0.9.3

6 years ago

0.9.2

6 years ago

0.9.1

6 years ago

0.9.0

6 years ago

0.7.20

6 years ago

0.7.19

6 years ago

0.8.15

6 years ago

0.8.14

6 years ago

0.8.13

6 years ago

0.8.12

6 years ago

0.8.11

6 years ago

0.8.10

6 years ago

0.8.9

6 years ago

0.8.8

6 years ago

0.8.7

6 years ago

0.8.6

6 years ago

0.8.5

6 years ago

0.8.4

6 years ago

0.8.3

6 years ago

0.8.2

6 years ago

0.8.1

6 years ago

0.8.0

6 years ago

0.7.18

6 years ago

0.7.17

6 years ago

0.7.16

6 years ago

0.7.15

6 years ago

0.7.14

6 years ago

0.7.13

6 years ago

0.7.12

6 years ago

0.7.11

6 years ago

0.7.10

6 years ago

0.7.9

6 years ago

0.7.8

6 years ago

0.7.7

6 years ago

0.7.6

6 years ago

0.7.5

6 years ago

0.7.4

6 years ago

0.7.3

6 years ago

0.7.2

6 years ago

0.7.1

6 years ago

0.7.0

6 years ago

0.6.6

6 years ago

0.6.5

6 years ago

0.6.4

6 years ago

0.6.3

6 years ago

0.6.2

6 years ago

0.6.1

6 years ago

0.6.0

6 years ago

0.5.5

6 years ago

0.5.4

6 years ago

0.5.3

6 years ago

0.5.2

6 years ago

0.5.1

6 years ago

0.4.0

6 years ago

0.3.29

6 years ago

0.3.28

6 years ago

0.3.27

6 years ago

0.3.26

6 years ago

0.3.25

6 years ago

0.3.24

6 years ago

0.3.23

6 years ago

0.3.22

6 years ago

0.3.19

6 years ago

0.3.17

6 years ago

0.3.16

6 years ago

0.3.15

6 years ago

0.3.14

6 years ago

0.3.13

6 years ago

0.3.12

6 years ago

0.3.11

6 years ago

0.3.10

6 years ago

0.3.9

6 years ago

0.3.8

6 years ago

0.3.7

6 years ago

0.3.6

6 years ago

0.3.5

6 years ago

0.3.4

6 years ago

0.3.3

6 years ago

0.3.2

6 years ago

0.3.1

6 years ago

0.3.0

6 years ago