@noreajs/core
Advanced tools
Comparing version 1.1.0-3 to 1.1.0-4
@@ -5,4 +5,4 @@ "use strict"; | ||
exports.group = group_1.default; | ||
var NoreaRouter_1 = require("./route/NoreaRouter"); | ||
exports.NoreaRouter = NoreaRouter_1.default; | ||
var Route_1 = require("./route/Route"); | ||
exports.Route = Route_1.default; | ||
var NoreaAppRoutes_1 = require("./route/NoreaAppRoutes"); | ||
@@ -9,0 +9,0 @@ exports.NoreaAppRoutes = NoreaAppRoutes_1.default; |
@@ -7,3 +7,2 @@ "use strict"; | ||
const express_1 = __importDefault(require("express")); | ||
const NoreaRouter_1 = __importDefault(require("./NoreaRouter")); | ||
/** | ||
@@ -14,6 +13,6 @@ * Group many routes to a single block | ||
* @param routes group routes | ||
*/ | ||
const group = function (middlewares, routes) { | ||
*/ | ||
function group(middlewares, routes) { | ||
const expressRouter = express_1.default.Router({ | ||
mergeParams: true | ||
mergeParams: true, | ||
}); | ||
@@ -25,5 +24,5 @@ // add middlewares to router | ||
// define routes | ||
routes(new NoreaRouter_1.default(expressRouter)); | ||
routes(expressRouter); | ||
return expressRouter; | ||
}; | ||
} | ||
exports.default = group; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/** | ||
* Norea router | ||
*/ | ||
class NoreaRouter { | ||
constructor(router) { | ||
this.router = router; | ||
} | ||
/** | ||
* Add prefix path to the given route path and return the route instance | ||
* @param path route path | ||
*/ | ||
route(path) { | ||
return this.router.route(`${path}`); | ||
} | ||
} | ||
exports.default = NoreaRouter; |
import express from "express"; | ||
import http from "http"; | ||
import https from "https"; | ||
import * as core from "express-serve-static-core"; | ||
@@ -21,14 +22,4 @@ export { express, http, https }; | ||
*/ | ||
export class NoreaRouter { | ||
router: express.Router; | ||
export interface NoreaRouter extends core.Router { } | ||
constructor(router: express.Router); | ||
/** | ||
* Add prefix path to the given route path and return the route instance | ||
* @param path route path | ||
*/ | ||
route: (path: string) => express.IRoute; | ||
} | ||
/** | ||
@@ -35,0 +26,0 @@ * Type of parameter used to initialize the initializer of the application routes......., yes you get it |
{ | ||
"name": "@noreajs/core", | ||
"version": "1.1.0-3", | ||
"version": "1.1.0-4", | ||
"description": "Norea.Js is a framework for building scalable Node.js server applications. Is is built with Typescript and use Express as web framework.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
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
10444
9
282
2