【问题标题】:passing run time configuration from springboot to Vue app将运行时配置从 Spring Boot 传递到 Vue 应用程序
【发布时间】:2020-07-14 15:33:14
【问题描述】:

我有一个使用 Gradle 构建 Springboot 应用程序的 VueJS 应用程序。

我的 vue 应用程序中确实有 env 文件,其中包含特定于环境的配置。

我使用 Gradle 进行 npm 构建并在那里传递 teh 模式以选择 env 文件但是我想构建一次在每个地方运行。

我想将配置从我的 application.properties 传递给 VUe 应用程序。

【问题讨论】:

    标签: spring-boot vue.js


    【解决方案1】:

    您可以通过在 spring-boot 中实现基于配置文件的配置来做到这一点。 这样您就可以使用环境变量来指定要使用的配置集。

    Here is the example of implementing profile based configuration

    【讨论】:

    • 感谢您的回复,但是我知道在 Springboot 中使用弹簧配置文件,但是我想将这些 env 传递给包装在里面的 vue 代码
    猜你喜欢
    • 2019-12-20
    • 2019-12-04
    • 2018-07-21
    • 2021-11-16
    • 1970-01-01
    • 2021-05-23
    • 1970-01-01
    相关资源
    最近更新 更多