adon-api
Advanced tools
Comparing version 2.0.1 to 2.1.0
@@ -1,2 +0,2 @@ | ||
export { ExpressApp, ExpressAppConfig } from './libs/ExpressApp'; | ||
export { default as EnvConfig } from './libs/ConfigHelper'; | ||
export { ExpressApp, ExpressAppConfig } from './ExpressApp'; | ||
export { default as config } from './config'; |
@@ -6,7 +6,7 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.EnvConfig = exports.ExpressApp = void 0; | ||
var ExpressApp_1 = require("./libs/ExpressApp"); | ||
exports.config = exports.ExpressApp = void 0; | ||
var ExpressApp_1 = require("./ExpressApp"); | ||
Object.defineProperty(exports, "ExpressApp", { enumerable: true, get: function () { return ExpressApp_1.ExpressApp; } }); | ||
var ConfigHelper_1 = require("./libs/ConfigHelper"); | ||
Object.defineProperty(exports, "EnvConfig", { enumerable: true, get: function () { return __importDefault(ConfigHelper_1).default; } }); | ||
var config_1 = require("./config"); | ||
Object.defineProperty(exports, "config", { enumerable: true, get: function () { return __importDefault(config_1).default; } }); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "adon-api", | ||
"version": "2.0.1", | ||
"version": "2.1.0", | ||
"description": "API for all Adon-based projects", | ||
@@ -11,6 +11,10 @@ "main": "dist/src/index.js", | ||
"scripts": { | ||
"build": "tsc", | ||
"start": "node dist/src/sample.js", | ||
"start:dev": "ts-node sample", | ||
"test": "jest" | ||
"start:server": "nodemon --config nodemon.json --exec ts-node sample/index.ts", | ||
"audit": "npm audit", | ||
"lint": "eslint \"src/**/*.ts\"", | ||
"snyk": "snyk test", | ||
"test": "jest --logHeapUsage", | ||
"test:coverage": "jest--logHeapUsage --coverage", | ||
"coveralls": "jest --logHeapUsage --coverage && cat ./coverage/lcov.info | coveralls", | ||
"build": "tsc" | ||
}, | ||
@@ -32,27 +36,39 @@ "repository": { | ||
"dependencies": { | ||
"body-parser": "^1.19.0", | ||
"cors": "^2.8.5", | ||
"dotenv": "^8.2.0", | ||
"express": "^4.17.1", | ||
"helmet": "^4.2.0", | ||
"http-error-types": "^1.0.1", | ||
"ioredis": "^4.19.2", | ||
"logger-template": "^1.0.1", | ||
"rate-limiter-flexible": "^2.2.1", | ||
"winston": "^3.3.3" | ||
"@godaddy/terminus": "4.7.1", | ||
"body-parser": "1.19.0", | ||
"cors": "2.8.5", | ||
"dotenv": "8.2.0", | ||
"express": "4.17.1", | ||
"helmet": "4.4.1", | ||
"http-error-types": "1.0.1", | ||
"ioredis": "4.26.0", | ||
"morgan": "1.10.0", | ||
"rate-limiter-flexible": "2.2.1", | ||
"rc": "^1.2.8", | ||
"winston": "3.3.3" | ||
}, | ||
"devDependencies": { | ||
"@types/cors": "^2.8.10", | ||
"@types/express": "4.17.3", | ||
"@types/helmet": "0.0.45", | ||
"@types/ioredis": "^4.17.8", | ||
"@types/node": "^14.14.12", | ||
"@types/winston": "^2.4.4", | ||
"@typescript-eslint/eslint-plugin": "^4.19.0", | ||
"@typescript-eslint/parser": "^4.19.0", | ||
"eslint": "^7.22.0", | ||
"eslint-config-airbnb-typescript": "^12.3.1", | ||
"eslint-plugin-import": "^2.22.1", | ||
"typescript": "^4.1.2" | ||
"@types/cors": "2.8.10", | ||
"@types/express": "4.17.11", | ||
"@types/helmet": "4.0.0", | ||
"@types/ioredis": "4.22.3", | ||
"@types/jest": "26.0.22", | ||
"@types/morgan": "1.9.2", | ||
"@types/node": "14.14.37", | ||
"@types/rc": "1.1.0", | ||
"@types/supertest": "^2.0.11", | ||
"@types/winston": "2.4.4", | ||
"@typescript-eslint/eslint-plugin": "4.21.0", | ||
"@typescript-eslint/parser": "4.21.0", | ||
"eslint": "7.24.0", | ||
"eslint-config-airbnb-typescript": "12.3.1", | ||
"eslint-plugin-import": "2.22.1", | ||
"jest": "26.6.3", | ||
"nodemon": "2.0.7", | ||
"snyk": "1.522.0", | ||
"supertest": "6.1.3", | ||
"ts-jest": "26.5.4", | ||
"ts-node": "9.1.1", | ||
"typescript": "4.2.4" | ||
} | ||
} |
@@ -1,4 +0,11 @@ | ||
# ADON-API | ||
# adon-api | ||
Express JS + Typescript + Jest development made easier. The goal is for us to easily build websites or APIs without managing the same dependencies and breaking out of our standards and conventions each time. We follow convention and configuration over code so that all future projects are handled easily. | ||
## Project stats | ||
* Package: [![npm](https://img.shields.io/npm/v/adon-api.svg)](https://www.npmjs.com/package/adon-api) [![npm](https://img.shields.io/npm/dm/adon-api.svg)](https://www.npmjs.com/package/adon-api) | ||
* License: [![GitHub](https://img.shields.io/github/license/adonisv79/adon-api.svg)](https://github.com/adonisv79/adon-api/blob/master/LICENSE) | ||
* CICD: [![Codacy Badge](https://app.codacy.com/project/badge/Grade/8308805088ac436b82f87e48a48633a1)](https://www.codacy.com/gh/adonisv79/adon-api/dashboard?utm_source=github.com&utm_medium=referral&utm_content=adonisv79/adon-api&utm_campaign=Badge_Grade) [![Known Vulnerabilities](https://snyk.io/test/github/adonisv79/adon-api/badge.svg)](https://snyk.io/test/github/adonisv79/adon-api) | ||
* develop: [![Build Status](https://www.travis-ci.com/adonisv79/adon-api.svg?branch=develop)](https://www.travis-ci.com/adonisv79/adon-api) [![Coverage Status](https://coveralls.io/repos/github/adonisv79/adon-api/badge.svg?branch=develop)](https://coveralls.io/github/adonisv79/adon-api?branch=develop) | ||
* master: [![Build Status](https://www.travis-ci.com/adonisv79/adon-api.svg?branch=master)](https://www.travis-ci.com/adonisv79/adon-api) [![Coverage Status](https://coveralls.io/repos/github/adonisv79/adon-api/badge.svg?branch=master)](https://coveralls.io/github/adonisv79/adon-api?branch=master) | ||
## How it works? | ||
@@ -9,2 +16,5 @@ * Express JS - our core framework is based on express and so this module will provide a library to easily kickstart an express js web service. | ||
* Rate Limitter, helm, etc - security mechanism as recommended from express (https://expressjs.com/en/advanced/best-practice-security.html) | ||
* Winston + Morgan - default logger mechanism | ||
* RC and DOTENV for configuration | ||
* @godaddy/terminus for healthcheck and handling graceful termination of the service | ||
@@ -59,5 +69,6 @@ ## Installation | ||
### Environment configurations | ||
As best practice, the service insist on setting your service level and security risk configurations within the environment. The EnvConfig module uses the dotEnv module to load all environment variables in a .env file which populates the config with all environment variables. | ||
* PORT - sets the prot number where the service will listed to. (Default: 3000) | ||
* SERVER_CORS_ALLOWED_ORIGINS - sets the allowed request origins urls. multiple URLs are divided by semicolon. (Default: '*') | ||
Create a file named '.env' in the root of the application. enter the following | ||
Either set in your machine environment the values or create a file named '.env' in the root of the application then enter the following | ||
```text | ||
@@ -67,2 +78,3 @@ PORT=3000 | ||
``` | ||
You can add more configurations here as much as you like and they can be accessed in code as | ||
@@ -69,0 +81,0 @@ ```javascript 1.6 |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
41855
30
478
107
2
12
22
2
+ Added@godaddy/terminus@4.7.1
+ Addedmorgan@1.10.0
+ Addedrc@^1.2.8
+ Added@godaddy/terminus@4.7.1(transitive)
+ Addedbasic-auth@2.0.1(transitive)
+ Addedbody-parser@1.19.0(transitive)
+ Addedbytes@3.1.0(transitive)
+ Addedcontent-disposition@0.5.3(transitive)
+ Addedcookie@0.4.0(transitive)
+ Addeddeep-extend@0.6.0(transitive)
+ Addeddepd@1.1.2(transitive)
+ Addeddestroy@1.0.4(transitive)
+ Addeddotenv@8.2.0(transitive)
+ Addedexpress@4.17.1(transitive)
+ Addedfinalhandler@1.1.2(transitive)
+ Addedhelmet@4.4.1(transitive)
+ Addedhttp-errors@1.7.2(transitive)
+ Addedinherits@2.0.3(transitive)
+ Addedini@1.3.8(transitive)
+ Addedioredis@4.26.0(transitive)
+ Addedminimist@1.2.8(transitive)
+ Addedmorgan@1.10.0(transitive)
+ Addedms@2.1.1(transitive)
+ Addedon-finished@2.3.0(transitive)
+ Addedon-headers@1.0.2(transitive)
+ Addedqs@6.7.0(transitive)
+ Addedrate-limiter-flexible@2.2.1(transitive)
+ Addedraw-body@2.4.0(transitive)
+ Addedrc@1.2.8(transitive)
+ Addedsafe-buffer@5.1.2(transitive)
+ Addedsend@0.17.1(transitive)
+ Addedserve-static@1.14.1(transitive)
+ Addedsetprototypeof@1.1.1(transitive)
+ Addedstatuses@1.5.0(transitive)
+ Addedstoppable@1.1.0(transitive)
+ Addedstrip-json-comments@2.0.1(transitive)
+ Addedtoidentifier@1.0.0(transitive)
+ Addedwinston@3.3.3(transitive)
- Removedlogger-template@^1.0.1
- Removedbody-parser@1.20.2(transitive)
- Removedbytes@3.1.2(transitive)
- Removedcall-bind@1.0.7(transitive)
- Removedcontent-disposition@0.5.4(transitive)
- Removedcookie@0.6.0(transitive)
- Removeddefine-data-property@1.1.4(transitive)
- Removeddestroy@1.2.0(transitive)
- Removeddotenv@8.6.0(transitive)
- Removedes-define-property@1.0.0(transitive)
- Removedes-errors@1.3.0(transitive)
- Removedexpress@4.19.2(transitive)
- Removedfinalhandler@1.2.0(transitive)
- Removedfunction-bind@1.1.2(transitive)
- Removedget-intrinsic@1.2.4(transitive)
- Removedgopd@1.0.1(transitive)
- Removedhas-property-descriptors@1.0.2(transitive)
- Removedhas-proto@1.0.3(transitive)
- Removedhas-symbols@1.0.3(transitive)
- Removedhasown@2.0.2(transitive)
- Removedhelmet@4.6.0(transitive)
- Removedhttp-errors@2.0.0(transitive)
- Removedinherits@2.0.4(transitive)
- Removedioredis@4.28.5(transitive)
- Removedlodash.isarguments@3.1.0(transitive)
- Removedlogger-template@1.0.1(transitive)
- Removedobject-inspect@1.13.1(transitive)
- Removedon-finished@2.4.1(transitive)
- Removedqs@6.11.0(transitive)
- Removedrate-limiter-flexible@2.4.2(transitive)
- Removedraw-body@2.5.2(transitive)
- Removedsend@0.18.0(transitive)
- Removedserve-static@1.15.0(transitive)
- Removedset-function-length@1.2.2(transitive)
- Removedsetprototypeof@1.2.0(transitive)
- Removedside-channel@1.0.6(transitive)
- Removedstatuses@2.0.1(transitive)
- Removedtoidentifier@1.0.1(transitive)
- Removedwinston@3.13.0(transitive)
Updatedbody-parser@1.19.0
Updatedcors@2.8.5
Updateddotenv@8.2.0
Updatedexpress@4.17.1
Updatedhelmet@4.4.1
Updatedhttp-error-types@1.0.1
Updatedioredis@4.26.0
Updatedrate-limiter-flexible@2.2.1
Updatedwinston@3.3.3