pwi-plata-type 0.3.0 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.ts +0 -2
- package/libs/routes.ts +2 -2
- package/package.json +1 -1
- package/templates/create-cli/route.ts +2 -2
package/index.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as PlataCluster from './libs/cluster.js'
|
|
2
2
|
import * as PlataEnv from './libs/env.js'
|
|
3
3
|
import * as PlataRoutes from './libs/routes.js'
|
|
4
|
-
import { PlataRouter } from './libs/routes.js'
|
|
5
4
|
import * as PlataTools from './libs/tools.js'
|
|
6
5
|
import * as PlataModels from './libs/model.js'
|
|
7
6
|
import { PlataSwagger } from './libs/swagger.js'
|
|
@@ -12,6 +11,5 @@ export {
|
|
|
12
11
|
PlataRoutes,
|
|
13
12
|
PlataTools,
|
|
14
13
|
PlataModels,
|
|
15
|
-
PlataRouter as PlataRouter,
|
|
16
14
|
PlataSwagger
|
|
17
15
|
}
|
package/libs/routes.ts
CHANGED
|
@@ -250,10 +250,10 @@ export async function buildExpressRouter(): Promise<Router> {
|
|
|
250
250
|
const prr = pr._routes[i];
|
|
251
251
|
|
|
252
252
|
if (prr.path === undefined) {
|
|
253
|
-
(router as any)[prr.method](...prr.handlers.map(PlataRoute))
|
|
253
|
+
(router as any)[prr.method](r.httpRoute, ...prr.handlers.map(PlataRoute))
|
|
254
254
|
} else {
|
|
255
255
|
(router as any)[prr.method](
|
|
256
|
-
path.normalize(`${r.httpRoute}/${prr.path}`),
|
|
256
|
+
path.normalize(`${r.httpRoute}/${prr.path}`).replace(/\\/g, '/'),
|
|
257
257
|
...prr.handlers.map(PlataRoute)
|
|
258
258
|
)
|
|
259
259
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
//@ts-nocheck
|
|
2
|
-
import {
|
|
2
|
+
import { PlataRoutes } from 'ç__PlataName__ç'
|
|
3
3
|
|
|
4
|
-
export default (router: PlataRouter): PlataRouter => {
|
|
4
|
+
export default (router: PlataRoutes.PlataRouter): PlataRoutes.PlataRouter => {
|
|
5
5
|
|
|
6
6
|
router.get('/', async (req, res) => {
|
|
7
7
|
return res.status(200).json({})
|