@lykmapipo/express-common
minimal express app configuration
Last updated 5 days ago by lykmapipo .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @lykmapipo/express-common 
SYNC missed versions from official npm registry.

express-common

Build Status Dependency Status npm version

minimal express app configuration.

It use below packages:

Note: It highly advice to use TLS

Requirements

  • NodeJS v9.3.0+
  • express v4.16.4+

Install

$ npm install --save @lykmapipo/express-common

Usage

const { get, post, patch, del, start } = require('@lykmapipo/express-common');

get('/v1/users', (req, res) => res.ok({ ... }));
get('/v1/users/:id', (req, res) => res.ok({ ... }));
post('/v1/users', (req, res) => res.created({ ... }));
patch('/v1/users:/id', (req, res) => res.ok({ ... }));
del('/v1/users:/id', (req, res) => res.ok({ ... }));

start(error => { ... });
curl http://0.0.0.0:5000/v1/users

Environment

NODE_ENV=development
PORT=5000

TRUST_PROXY=false

SERVE_STATIC=true
SERVE_STATIC_PATH=public
SERVE_FAVICON=false

BODY_PARSER_LIMIT=2mb
BODY_PARSER_JSON_TYPE=application/json

HELMET_HSTS=false

MQUERY_LIMIT=10
MQUERY_MAX_LIMIT=50

LOGGER_LOG_ENABLED=true
LOGGER_LOG_LEVEL=silly
LOGGER_USE_CONSOLE=true
LOGGER_USE_FILE=true
LOGGER_LOG_PATH=./logs/app-%DATE%.log
LOGGER_LOG_IGNORE=password,apiKey,secret,client_secret
LOGGER_LOG_HTTP_FORMAT=combined

Testing

  • Clone this repository

  • Install all development dependencies

$ npm install
  • Then run test
$ npm test

Contribute

It will be nice, if you open an issue first so that we can know what is going on, then, fork this repo and push in your ideas. Do not forget to add a bit of test(s) of what value you adding.

References

Licence

The MIT License (MIT)

Copyright (c) lykmapipo & Contributors

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Current Tags

  • 0.18.5                                ...           latest (5 days ago)

61 Versions

  • 0.18.5                                ...           5 days ago
  • 0.18.4                                ...           17 days ago
  • 0.18.3                                ...           a month ago
  • 0.18.2                                ...           a month ago
  • 0.18.1                                ...           2 months ago
  • 0.18.0                                ...           2 months ago
  • 0.17.24                                ...           2 months ago
  • 0.17.23                                ...           3 months ago
  • 0.17.22                                ...           3 months ago
  • 0.17.21                                ...           4 months ago
  • 0.17.20                                ...           4 months ago
  • 0.17.19                                ...           4 months ago
  • 0.17.18                                ...           5 months ago
  • 0.17.17                                ...           5 months ago
  • 0.17.16                                ...           6 months ago
  • 0.17.15                                ...           6 months ago
  • 0.17.14                                ...           7 months ago
  • 0.17.13                                ...           8 months ago
  • 0.17.12                                ...           8 months ago
  • 0.17.11                                ...           9 months ago
  • 0.17.10                                ...           10 months ago
  • 0.17.9                                ...           a year ago
  • 0.17.8                                ...           a year ago
  • 0.17.7                                ...           a year ago
  • 0.17.6                                ...           a year ago
  • 0.17.5                                ...           a year ago
  • 0.17.4                                ...           a year ago
  • 0.17.3                                ...           a year ago
  • 0.17.2                                ...           a year ago
  • 0.17.1                                ...           a year ago
  • 0.17.0                                ...           a year ago
  • 0.16.1                                ...           a year ago
  • 0.16.0                                ...           a year ago
  • 0.15.0                                ...           a year ago
  • 0.14.0                                ...           a year ago
  • 0.13.1                                ...           a year ago
  • 0.13.0                                ...           a year ago
  • 0.12.3                                ...           a year ago
  • 0.12.2                                ...           a year ago
  • 0.12.1                                ...           a year ago
  • 0.12.0                                ...           a year ago
  • 0.11.0                                ...           a year ago
  • 0.10.2                                ...           a year ago
  • 0.10.1                                ...           a year ago
  • 0.10.0                                ...           a year ago
  • 0.9.4                                ...           a year ago
  • 0.9.3                                ...           2 years ago
  • 0.9.2                                ...           2 years ago
  • 0.9.1                                ...           2 years ago
  • 0.9.0                                ...           2 years ago
  • 0.8.0                                ...           2 years ago
  • 0.7.1                                ...           2 years ago
  • 0.7.0                                ...           2 years ago
  • 0.6.0                                ...           2 years ago
  • 0.5.1                                ...           2 years ago
  • 0.5.0                                ...           2 years ago
  • 0.4.0                                ...           2 years ago
  • 0.3.1                                ...           2 years ago
  • 0.3.0                                ...           2 years ago
  • 0.2.0                                ...           2 years ago
  • 0.1.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 1
This Month 1
Last Day 0
Last Week 12
Last Month 47
Dependencies (18)

Copyright 2014 - 2016 © taobao.org |