added to templates

This commit is contained in:
Tony Tam
2016-01-06 09:31:14 -08:00
parent 151de79a98
commit 1110bd7a08
2 changed files with 18 additions and 1 deletions

View File

@@ -245,6 +245,23 @@ public class NodeJSServerCodegen extends DefaultCodegen implements CodegenConfig
}
@Override
public void preprocessSwagger(Swagger swagger) {
if ("/".equals(swagger.getBasePath())) {
swagger.setBasePath("");
}
String host = swagger.getHost();
String port = "8080";
if (host != null) {
String[] parts = host.split(":");
if (parts.length > 1) {
port = parts[1];
}
}
this.additionalProperties.put("serverPort", port);
}
@Override
public Map<String, Object> postProcessSupportingFileData(Map<String, Object> objs) {
Swagger swagger = (Swagger)objs.get("swagger");
if(swagger != null) {