Skip to content

Commit 78dedb9

Browse files
updated swagger
1 parent e9a736b commit 78dedb9

File tree

5 files changed

+29
-50
lines changed

5 files changed

+29
-50
lines changed

.env.test

Lines changed: 0 additions & 4 deletions
This file was deleted.

README.md

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,14 @@ Try it!! I am happy to hear your feedback or any kind of new features.
4545

4646
- Clone the Application `git clone https://github.com/santoshshinde2012/node-boilerplate.git`
4747
- Install the dependencies `npm install`
48-
- Start the application `npm run start:local`
48+
- Start the application `npm run dev`
4949

5050
## Start The application in Production Mode
5151

5252
- Install the dependencies `npm install`
5353
- Create the build `npm run build`
54-
- Start the application `npm run start:production`
55-
- Before starting make sure to creat prod environment `.env.prod` file
54+
- Start the application `npm run start`
55+
- Before starting make sure to update your `.env` values for your refrence just check `.env.example`
5656

5757

5858
## Project Structure
@@ -63,7 +63,6 @@ Try it!! I am happy to hear your feedback or any kind of new features.
6363
| **src/** | Source files |
6464
| **src/abstractions** | Abstarct classes and Interfaces |
6565
| **src/components** | REST API Components & Controllers |
66-
| **src/environments** | Application Environments Handling utility |
6766
| **src/lib** | Reusable utilises and library source code like a logger|
6867
| **src/middleware/** | Express Middlewares like error handler feature |
6968
| **build/** | Compiled source files will be placed here |
@@ -81,14 +80,6 @@ Try it!! I am happy to hear your feedback or any kind of new features.
8180

8281
Set the `APPLY_ENCRYPTION` environment variable to `true` to enable encryption.
8382

84-
## Global Environment Object
85-
86-
You can directly access the environment attributes in any component/file using global environment object. For more details please check file `src/global.ts`.
87-
88-
*Example*
89-
90-
To access the `applyEncryption` attribute from `Envionment` class to Response Handler, write `environment.applyEncryption`;
91-
9283
## Swagger API Documentation
9384

9485
The swagger documentation is available at the following url `${host}/docs`:

package.json

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,14 @@
77
"start": "node build/src/server.js",
88
"dev": "nodemon index.js",
99
"build": "tsc -p . && cp package.json ./build/package.json && cp package-lock.json ./build/package-lock.json && cp .env ./build/.env",
10-
"build:test": "npm run lint && tsc -p . && cp .env ./build/.env && cp .env.test ./build/.env.test",
11-
"build:prod": "tsc -p . && cp .env ./build/.env && cp .env.prod ./build/.env.prod",
12-
"build:stag": "tsc -p . && cp .env ./build/.env && cp .env.stag ./build/.env.stag",
13-
"start:local": "npm run lint && NODE_ENV=local nodemon index.js",
14-
"start:test": "NODE_ENV=test node build/src/server.js",
15-
"start:staging": "NODE_ENV=staging node build/src/server.js",
16-
"start:prod": "NODE_ENV=production node build/src/server.js",
17-
"prod": "node build/src/server.js",
1810
"lint": "eslint src/**/*.ts",
1911
"lint-fix": "eslint --fix src/**/*.ts",
2012
"pretty": "prettier --write \"src/**/*.ts\"",
2113
"prepare": "husky install",
2214
"test:custom": "npm test -- tests/unit-tests/lib/crypto.spec.ts",
2315
"precommit": "npm run lint-fix && npm run pretty",
2416
"prepush": "npm run lint ",
25-
"test": "NODE_ENV=test jest --coverage",
17+
"test": "jest --coverage",
2618
"test:watch": "jest --watch"
2719
},
2820
"author": "Santosh Shinde",

swagger.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
"title": "Node Boilerplate"
77
},
88
"host": "",
9-
"basePath": "/system",
9+
"basePath": "",
1010
"tags": [{
1111
"name": "node-boilerplate",
1212
"description": "Node Typescript Boilerplate"
1313
}],
1414
"schemes": ["http", "https"],
1515
"paths": {
16-
"/info": {
16+
"/system/info": {
1717
"get": {
1818
"tags": ["node-boilerplate"],
1919
"summary": "get system status",
@@ -29,7 +29,7 @@
2929
"security": []
3030
}
3131
},
32-
"/time": {
32+
"/system/time": {
3333
"get": {
3434
"tags": ["node-boilerplate"],
3535
"summary": "get server time",
@@ -45,7 +45,7 @@
4545
"security": []
4646
}
4747
},
48-
"/usage": {
48+
"/system/usage": {
4949
"get": {
5050
"tags": ["node-boilerplate"],
5151
"summary": "get server usage",
@@ -61,7 +61,7 @@
6161
"security": []
6262
}
6363
},
64-
"/process": {
64+
"/system/process": {
6565
"get": {
6666
"tags": ["node-boilerplate"],
6767
"summary": "get server process",

test-report.xml

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,43 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<testExecutions version="1">
3-
<file path="/Users/santosh/Documents/workspace/personal/node-boilerplate/tests/unit-tests/lib/crypto.spec.ts">
4-
<testCase name="Crypto Lib (Encryption/Decryption) Testing for text" duration="7"/>
5-
<testCase name="Crypto Lib (Encryption/Decryption) Testing for array" duration="2"/>
6-
<testCase name="Crypto Lib (Encryption/Decryption) Testing for object" duration="3"/>
7-
</file>
83
<file path="/Users/santosh/Documents/workspace/personal/node-boilerplate/tests/unit-tests/dummy.spec.ts">
9-
<testCase name="Dummy Test Cases Verify Jest is working" duration="6"/>
4+
<testCase name="Dummy Test Cases Verify Jest is working" duration="3"/>
105
</file>
116
<file path="/Users/santosh/Documents/workspace/personal/node-boilerplate/tests/unit-tests/lib/logger.spec.ts">
12-
<testCase name="Logger Lib should create a new log directory if one doesn&apos;t already exist" duration="9"/>
7+
<testCase name="Logger Lib should create a new log directory if one doesn&apos;t already exist" duration="7"/>
8+
</file>
9+
<file path="/Users/santosh/Documents/workspace/personal/node-boilerplate/tests/unit-tests/lib/crypto.spec.ts">
10+
<testCase name="Crypto Lib (Encryption/Decryption) Testing for text" duration="6"/>
11+
<testCase name="Crypto Lib (Encryption/Decryption) Testing for array" duration="1"/>
12+
<testCase name="Crypto Lib (Encryption/Decryption) Testing for object" duration="2"/>
1313
</file>
1414
<file path="/Users/santosh/Documents/workspace/personal/node-boilerplate/tests/unit-tests/components/SystemStatusController.spec.ts">
15-
<testCase name="System Status Controller test getError method" duration="3"/>
15+
<testCase name="System Status Controller test getError method" duration="2"/>
1616
<testCase name="System Status Controller test getSystemInfo method" duration="3"/>
1717
<testCase name="System Status Controller test getSystemInfo method with updated env variables" duration="2"/>
18-
<testCase name="System Status Controller test getSystemInfo method with exception" duration="1"/>
19-
<testCase name="System Status Controller test getServerTime method" duration="0"/>
20-
<testCase name="System Status Controller test getServerTime method with exception" duration="1"/>
18+
<testCase name="System Status Controller test getSystemInfo method with exception" duration="0"/>
19+
<testCase name="System Status Controller test getServerTime method" duration="1"/>
20+
<testCase name="System Status Controller test getServerTime method with exception" duration="0"/>
2121
<testCase name="System Status Controller test getResourceUsage method" duration="0"/>
22-
<testCase name="System Status Controller test getResourceUsage method with exception" duration="1"/>
23-
<testCase name="System Status Controller test getProcessInfo method" duration="0"/>
22+
<testCase name="System Status Controller test getResourceUsage method with exception" duration="0"/>
23+
<testCase name="System Status Controller test getProcessInfo method" duration="1"/>
2424
<testCase name="System Status Controller test getProcessInfo method with exception" duration="0"/>
2525
</file>
2626
<file path="/Users/santosh/Documents/workspace/personal/node-boilerplate/tests/unit-tests/middleware/error-handler.spec.ts">
27-
<testCase name="ErrorHandler middleware with 0 status code" duration="5"/>
28-
<testCase name="ErrorHandler middleware with 200 status code" duration="1"/>
27+
<testCase name="ErrorHandler middleware with 0 status code" duration="4"/>
2928
<testCase name="ErrorHandler middleware with 200 status code" duration="0"/>
30-
<testCase name="ErrorHandler middleware with 200 status code and updated env variables" duration="2"/>
29+
<testCase name="ErrorHandler middleware with 200 status code" duration="1"/>
30+
<testCase name="ErrorHandler middleware with 200 status code and updated env variables" duration="1"/>
3131
</file>
3232
<file path="/Users/santosh/Documents/workspace/personal/node-boilerplate/tests/integration-tests/app.integration.spec.ts">
33-
<testCase name="status integration tests can get default route success" duration="15"/>
33+
<testCase name="status integration tests can get default route success" duration="16"/>
3434
<testCase name="status integration tests can get default web route success" duration="2"/>
3535
</file>
3636
<file path="/Users/santosh/Documents/workspace/personal/node-boilerplate/tests/integration-tests/status.integration.spec.ts">
37-
<testCase name="status integration tests can get server time" duration="15"/>
38-
<testCase name="status integration tests can get server system info" duration="6"/>
37+
<testCase name="status integration tests can get server time" duration="16"/>
38+
<testCase name="status integration tests can get server system info" duration="4"/>
3939
<testCase name="status integration tests can get server system usage" duration="2"/>
4040
<testCase name="status integration tests can get server system process info" duration="2"/>
41-
<testCase name="status integration tests should get the error" duration="4"/>
41+
<testCase name="status integration tests should get the error" duration="3"/>
4242
</file>
4343
</testExecutions>

0 commit comments

Comments
 (0)