mirror of
https://github.com/strapi/strapi.git
synced 2025-11-11 15:49:50 +00:00
Fix wrong router loop
This commit is contained in:
parent
7259bc54f6
commit
2013164680
@ -47,12 +47,11 @@ module.exports = strapi => {
|
|||||||
_.forEach(api.routes, route => {
|
_.forEach(api.routes, route => {
|
||||||
// nested router
|
// nested router
|
||||||
if (_.has(route, 'routes')) {
|
if (_.has(route, 'routes')) {
|
||||||
for (const key in api.routes) {
|
for (const key in route.routes) {
|
||||||
const routerInfo = api.routes[key];
|
const routerInfo = route.routes[key];
|
||||||
|
|
||||||
const router = new Router({ prefix: routerInfo.prefix });
|
const router = new Router({ prefix: routerInfo.prefix });
|
||||||
|
|
||||||
// TODO:: support router routes
|
|
||||||
for (const route of routerInfo.routes || []) {
|
for (const route of routerInfo.routes || []) {
|
||||||
composeEndpoint(route, { apiName, router });
|
composeEndpoint(route, { apiName, router });
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user