mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-14 21:31:50 +00:00
fix: handle SIGTERM in dashboard serve.js; always include API_URL in webpack build
This commit is contained in:
parent
f3fcede7f5
commit
9e65f05b23
2 changed files with 7 additions and 2 deletions
|
@ -17,3 +17,9 @@ fastify.listen({ port: 3002, host: '0.0.0.0' }, (err, address) => {
|
|||
}
|
||||
console.log(`Server listening on ${address}`);
|
||||
});
|
||||
|
||||
process.on("SIGTERM", () => {
|
||||
fastify.close().then(() => {
|
||||
process.exit(0);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -153,6 +153,7 @@ let config = {
|
|||
new DotenvPlugin({
|
||||
path: path.resolve(process.cwd(), "../.env"),
|
||||
}),
|
||||
new webpack.EnvironmentPlugin(["API_URL"]),
|
||||
],
|
||||
resolve: {
|
||||
extensions: [".ts", ".tsx", ".js", ".mjs", ".vue"],
|
||||
|
@ -161,8 +162,6 @@ let config = {
|
|||
},
|
||||
};
|
||||
|
||||
if (process.env.NODE_ENV === "web") config.plugins.push(new webpack.EnvironmentPlugin(["NODE_ENV", "API_URL"]));
|
||||
|
||||
if (process.env.NODE_ENV === "production") {
|
||||
config = merge(config, {
|
||||
mode: "production",
|
||||
|
|
Loading…
Add table
Reference in a new issue