RicoSuter/NSwag

Set BaseUrl for Typescript clients?

Open

#1,198 opened on 2018年2月16日

GitHub で見る
 (10 comments) (0 reactions) (0 assignees)C# (6,291 stars) (1,189 forks)batch import
help wantedtype: enhancement

説明

NSwagStudio v11.15.3.0. Generating typescript client for C# web api controllers. My GUI is served from one url and the webapi is from another url (on the same machine). Just the path is different. I see in the generated ts file a baseUrl variable. This appears tied to the Studio's ServiceHost setting. I don't see any way to just provide a different path. If I set just the path into studio, '/MyProjectWebApi', it's prepending http: onto the beginning and it doesn't work. If I hand edit baseUrl to '/MyProjectWebApi', it does work.

Is there any way for me to set just an alternate path? but have it keep using whatever the app schema and host name was used?

If the ServiceHost starts with a '/', could it stop adding http? I tried experimenting with a '.', but no luck.

コントリビューターガイド