-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(core): ⚡ new changes based on WrappidApp implementation
new changes based on WrappidApp implementation in server.ts Ref #117
- Loading branch information
Showing
11 changed files
with
1,859 additions
and
260 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
import { CoreControllersRegistry } from "@wrappid/service-core"; | ||
import * as modulesControllersRegistry from "../modules/modules.controllers.registry"; | ||
|
||
const ControllersRegistry: any = { | ||
...modulesControllersRegistry.default, | ||
...CoreControllersRegistry, | ||
}; | ||
export default ControllersRegistry; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
import { CoreFunctionsRegistry } from "@wrappid/service-core"; | ||
import * as modulesFunctionsRegistry from "../modules/modules.functions.registry"; | ||
|
||
const FunctionsRegistry = { | ||
...modulesFunctionsRegistry.default, | ||
...CoreFunctionsRegistry, | ||
}; | ||
export default FunctionsRegistry; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
import { CoreMiddlewaresRegistry } from "@wrappid/service-core"; | ||
import * as modulesMiddlewaresRegistry from "../modules/modules.middlewares.registry"; | ||
|
||
const MiddlewaresRegistry = { | ||
...modulesMiddlewaresRegistry.default, | ||
...CoreMiddlewaresRegistry, | ||
}; | ||
|
||
export default MiddlewaresRegistry; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
import { CoreModelsRegistry } from "@wrappid/service-core"; | ||
import * as modulesModelsRegistry from "../modules/modules.models.registry"; | ||
|
||
const ModelsRegistry = { | ||
...modulesModelsRegistry.default, | ||
...CoreModelsRegistry, | ||
}; | ||
export default ModelsRegistry; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
import { CoreTasksRegistry } from "@wrappid/service-core"; | ||
import * as modulesTasksRegistry from "../modules/modules.tasks.registry"; | ||
|
||
const TasksRegistry = { | ||
...modulesTasksRegistry.default, | ||
...CoreTasksRegistry, | ||
}; | ||
export default TasksRegistry; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
import { CoreValidationsRegistry } from "@wrappid/service-core"; | ||
import * as modulesValidationsRegistry from "../modules/modules.validations.registry"; | ||
|
||
const ValidationsRegistry = { | ||
...modulesValidationsRegistry, | ||
...CoreValidationsRegistry, | ||
}; | ||
export default ValidationsRegistry; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,53 @@ | ||
console.log("###########################################"); | ||
console.log("server.js start"); | ||
console.log("###########################################"); | ||
import { DEFAULT_PORT, WrappidApp } from "@wrappid/service-core"; | ||
|
||
import { DEFAULT_PORT, app } from "@wrappid/service-core"; | ||
import express from "express"; | ||
import applicationConfig from "./config.json"; | ||
import ControllersRegistry from "./registry/ControllersRegistry"; | ||
import FunctionsRegistry from "./registry/FunctionsRegistry"; | ||
import MiddlewaresRegistry from "./registry/MiddlewaresRegistry"; | ||
import ModelsRegistry from "./registry/ModelsRegistry"; | ||
import RoutesRegistry from "./registry/Routes.Registry"; | ||
import TasksRegistry from "./registry/TasksRegistry"; | ||
import swaggerJsonFile from "./swagger-output.json"; | ||
import ValidationsRegistry from "./registry/ValidationsRegistry"; | ||
import swaggerJson from "./swagger-output.json"; | ||
|
||
const wrappidApp: any = express(); | ||
try { | ||
|
||
app(wrappidApp,ControllersRegistry, FunctionsRegistry, ModelsRegistry, RoutesRegistry, TasksRegistry, swaggerJsonFile); | ||
console.log("###########################################"); | ||
console.log("server.js start"); | ||
console.log("###########################################"); | ||
|
||
const __PORT = process.env.PORT || DEFAULT_PORT; | ||
|
||
const wrappidApp = new WrappidApp({ | ||
port: __PORT, | ||
cors: { origin: "*" }, | ||
bodyPerser: { | ||
json: { limit: "50mb" }, | ||
raw: { | ||
inflate: true, | ||
limit: "50mb", | ||
type: "application/octet-stream", | ||
}, | ||
urlencoded: { extended: true } | ||
}, | ||
registry: { | ||
ControllersRegistry, | ||
FunctionsRegistry, | ||
ModelsRegistry, | ||
RoutesRegistry, | ||
TasksRegistry, | ||
MiddlewaresRegistry, | ||
ValidationsRegistry | ||
}, | ||
swagger: { ...swaggerJson }, | ||
config: { ...applicationConfig } | ||
}); | ||
|
||
const serverInit = () => { | ||
console.log("###########################################"); | ||
console.log(`Server is up and running on port ${__PORT}...`); | ||
console.log("###########################################"); | ||
}; | ||
|
||
wrappidApp.listen(__PORT, serverInit); | ||
wrappidApp.init(); | ||
|
||
} catch (error: any) { | ||
console.error(error); | ||
} finally { | ||
console.log("###########################################"); | ||
console.log("server.js end"); | ||
console.log("###########################################"); | ||
|
||
} catch (error: any) { | ||
console.log(error); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters