krakenjs / swaggerize-express

Design-driven apis with swagger 2.0 and express.
Other
354 stars 81 forks source link

Setting api path manually doesn't work #114

Open Kashio opened 7 years ago

Kashio commented 7 years ago

I use swagger-express manually like the following: app.use(swaggerize({ api: require(path.join(__dirname, 'swagger.json')), handlers: path.join(__dirname, 'routes') })); swagger.json is in the same directory as my app.js (express middleware registration logic), when I try to go to one of my route, I get:

Error: Error opening file "c:/Users/user/WebstormProjects/proj/config/swagger.json" ENOENT: no such file or directory, open 'c:\Users\user\WebstormProjects\proj\config\swagger.json'

As if it still looks for the api file not where I've told it to, but in the config\swagger.json path.

subeeshcbabu-zz commented 7 years ago

@Kashio - can you link your github url