node-red / node-red-node-swagger

A set of tools for generating Swagger api documentation based on the HTTP nodes deployed in a flow
Apache License 2.0
62 stars 48 forks source link

Unable to load SwaggerUI in Embedded architecture #46

Closed oprince closed 7 years ago

oprince commented 7 years ago

We are running NR in Embedded architecture Swagger UI does not load in NR editor. The following error is printed to the Browser console: GET http://localhost:1881/apihttp-api/swagger.json 404 (Not Found) Unable to load SwaggerUI Please suggest how to solve that Thanks!

knolleary commented 7 years ago

What value of httpAdminRoot and httpNodeRoot are you passing in your settings to the runtime?

oprince commented 7 years ago

httpNodeRoot: '/api', httpAdminRoot: '/red'

knolleary commented 7 years ago

The the URL that 404s, it looks like a / is missing between api and http-api.

Try adding a trailing slash to these config properties:

httpNodeRoot: '/api/',
httpAdminRoot: '/red/'

This is something that red.js does which, as you're embedding, you're not benefiting from.

oprince commented 7 years ago

Thanks !! This solves the problem !