mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-06-16 05:40:53 +00:00
added basePath
This commit is contained in:
parent
d12a565032
commit
9ffece910d
@ -31,7 +31,7 @@
|
|||||||
<version>${jetty-version}</version>
|
<version>${jetty-version}</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<webAppConfig>
|
<webAppConfig>
|
||||||
<contextPath>/</contextPath>
|
<contextPath>{{^basePath}}/{{/basePath}}{{#basePath}}{{basePath}}{{/basePath}}</contextPath>
|
||||||
</webAppConfig>
|
</webAppConfig>
|
||||||
<webAppSourceDirectory>target/${project.artifactId}-${project.version}</webAppSourceDirectory>
|
<webAppSourceDirectory>target/${project.artifactId}-${project.version}</webAppSourceDirectory>
|
||||||
<webDefaultXml>${project.basedir}/conf/jetty/webdefault.xml</webDefaultXml>
|
<webDefaultXml>${project.basedir}/conf/jetty/webdefault.xml</webDefaultXml>
|
||||||
|
@ -20,7 +20,17 @@ var corsOptions = {
|
|||||||
|
|
||||||
app.use(cors(corsOptions));
|
app.use(cors(corsOptions));
|
||||||
|
|
||||||
|
{{#basePath}}
|
||||||
|
var subpath = express();
|
||||||
|
|
||||||
|
app.use("{{{basePath}}}", subpath);
|
||||||
|
|
||||||
|
swagger.setAppHandler(subpath);
|
||||||
|
{{/basePath}}
|
||||||
|
{{^basePath}}
|
||||||
swagger.setAppHandler(app);
|
swagger.setAppHandler(app);
|
||||||
|
{{/basePath}}
|
||||||
|
|
||||||
swagger.configureSwaggerPaths("", "api-docs", "")
|
swagger.configureSwaggerPaths("", "api-docs", "")
|
||||||
|
|
||||||
var models = require("./app/models.js");
|
var models = require("./app/models.js");
|
||||||
@ -36,7 +46,7 @@ swagger.addModels(models)
|
|||||||
{{/apis}}{{/apiInfo}};
|
{{/apis}}{{/apiInfo}};
|
||||||
|
|
||||||
// configures the app
|
// configures the app
|
||||||
swagger.configure("http://localhost:8002", "0.1");
|
swagger.configure("http://localhost:8002{{basePath}}", "0.1");
|
||||||
|
|
||||||
// start the server
|
// start the server
|
||||||
app.listen(8002);
|
app.listen(8002);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user