Skip to content

Commit 00847f3

Browse files
Merge pull request #24 from onixjs/development
Development
2 parents 1272420 + 21230c3 commit 00847f3

File tree

5 files changed

+33
-20
lines changed

5 files changed

+33
-20
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,11 @@ The **[OnixJS] FrameWork** is an ***Enterprise Grade*** **Node.JS** platform tha
4747

4848

4949
- **Slightly Opinionated**: Though [OnixJS] provide with a business logic structure based on *SOA*, *MSA* and it does specify how to communicate your services or clients, *we do empower you* to decide which *Front-End Framework*, *ORM* or even an *Server Side Renderer* (Template Engine) to install. By using any of our provided [Factories], you'll be free to make most of the important decisions.
50+
<<<<<<< HEAD
51+
- **Stability**: We strongly believe that providing a highly featured, tested or covered framework is great but not enough. We also believe that staging or deploying a project now or in a year MUSTN'T be affected by the framework or any of its dependencies, being that the reason of why we decided to use the lowest amount of dependencies possible.
52+
=======
5053
- **Stability**: We strongly believe that providing a highly featured, tested or covered platform might be great but definitely not enough. We also believe that staging or deploying a project now or in a year MUSTN'T be affected by the Framework or any of its dependencies, being that the reason of why we decided to use the lowest amount of dependencies possible.
54+
>>>>>>> master
5155
- **High-Availability**: Either you choose Monolithic *SOA* or *MSA*, your services will run independently in separated processes. While implementing the right patterns and infrastructure, any failure on either of your services won't block or disable access to users or other services.
5256
- **High-Performance**: [OnixJS] provides with a really small footprint, we don't really add unnecessary and unused features, instead we provide you with artifacts all based on established design patterns for you to build projects with ease, as well as providing ways to flawlessly communicate services and clients.
5357
- **Security**: [OnixJS] provides with a fully [OIDC] featured *Single Sign On* IdP, so you can start avoiding expenses on authentication and authorization issues due far simplistic auth implementations not suited for enterprise grade projects.

package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@onixjs/core",
3-
"version": "1.0.0-alpha.17.1",
3+
"version": "1.0.0-alpha.18",
44
"description": "The High-Performance SOA Real-Time Framework for Node.JS",
55
"main": "dist/src/index.js",
66
"scripts": {
@@ -48,11 +48,12 @@
4848
"node": ">=8.10.0"
4949
},
5050
"dependencies": {
51+
"@onixjs/enumerable": "^1.0.0-alpha.7",
5152
"@onixjs/sdk": "^1.0.0-alpha.4.4",
52-
"uws": "^9.14.0",
53-
"router": "^1.3.2",
5453
"finalhandler": "^1.1.1",
55-
"reflect-metadata": "^0.1.12"
54+
"reflect-metadata": "^0.1.12",
55+
"router": "^1.3.2",
56+
"uws": "^9.14.0"
5657
},
5758
"devDependencies": {
5859
"@types/mongodb": "^3.0.5",

src/core/app.factory.ts

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ export class AppFactory {
9999
*/
100100
public async setup() {
101101
// Iterate list of module classes
102-
return promiseSeries(
102+
const result = await promiseSeries(
103103
this.config.modules.map((Module: Constructor) => async () => {
104104
//this.config.modules.forEach(async (Module: Constructor) => {
105105
console.log('Module Name: ', Module.name);
@@ -129,13 +129,15 @@ export class AppFactory {
129129
this.app.modules[Module.name],
130130
Module,
131131
);
132-
if (process.send)
133-
process.send({
134-
type: OperationType.APP_CREATE_RESPONSE,
135-
message: this.schema(),
136-
});
137132
}),
138133
);
134+
if (process.send)
135+
process.send({
136+
type: OperationType.APP_CREATE_RESPONSE,
137+
message: this.schema(),
138+
});
139+
140+
return result;
139141
}
140142
/**
141143
* @method setupComponents
@@ -361,13 +363,17 @@ export class AppFactory {
361363
}),
362364
);
363365
}
364-
// read file from file system
365-
const data = await AsyncReadFile(pathname);
366-
// Potentially get cookies and headers
367-
const result = await instance[method](req, data);
368-
// Set response headers
369-
res.setHeader('Content-type', map[ext] || 'text/plain');
370-
res.end(Utils.IsJsonString(result) ? JSON.stringify(result) : result);
366+
try {
367+
// read file from file system
368+
const data = await AsyncReadFile(pathname);
369+
// Potentially get cookies and headers
370+
const result = await instance[method](req, data);
371+
// Set response headers
372+
res.setHeader('Content-type', map[ext] || 'text/plain');
373+
res.end(Utils.IsJsonString(result) ? JSON.stringify(result) : result);
374+
} catch (e) {
375+
next();
376+
}
371377
}
372378
}
373379
/**

src/core/host.boot.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {OnixJS} from '../index';
1+
import {OnixJS, promiseSeries} from '../index';
22
import * as path from 'path';
33
import {OnixConfig, BootConfig} from '../interfaces';
44
/**
@@ -56,7 +56,9 @@ export class HostBoot {
5656
}
5757

5858
async run() {
59-
this.bc.apps.forEach(async app => await this.host.load(app));
59+
await promiseSeries(
60+
this.bc.apps.map(app => async () => this.host.load(app)),
61+
);
6062
await this.host.start();
6163
}
6264
}

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export class OnixJS {
3333
* @description Current Onix Version.
3434
*/
3535
get version(): string {
36-
return '1.0.0-alpha.17.1';
36+
return '1.0.0-alpha.18';
3737
}
3838
/**
3939
* @property server

0 commit comments

Comments
 (0)