swagger-node-codegen
swagger-node-codegen copied to clipboard
No routes nor services are generated
The server is properly generated saying "Done" without errors.
However no files are generated under src/api/routes
and src/api/services
.
Which lead to this error:
Error: Cannot find module './routes/server-settings'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Module.require (internal/modules/cjs/loader.js:690:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.<anonymous> (C:\Users\SESA351036\Documents\Dev\schneider\edm\test\my-api\src\api\index.js:17:29)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
Yeah, not sure why this package exists? It doesn't seem to do anything much.
Hi, When using the generator in my code at the first time the routes and services folder are generated inside the node_modules/swagger-node-codegen folder. at the next run they are generated in the correct folder, maybe linked ?
Hey, I created template for koa router. However I'm experienced the same issue like @Demonium described above. I cloned your project and add my koa template to the templates folder. Once I ran generate method js files created in templates/koa/api/routes and services folders. The aforementioned js files generated only after second run.