Starts in:
1 DAY
4 HRS
13 MIN
24 SEC
Starts in:
1 D
4 H
13 M
24 S
Open Closed

using-another-json-file-instead-of-environment #8052


User avatar
0
nabass created

hi when i make publish from angular application and upload it to IIS server and my partner trying to open it he has another localhost for example my localhost is 44388 and his local is 44255 so application will not run he must open the source code and change localhost within environment file and this file will be not editable to change the port when production so what i did is 1- creating new Config.json file and put the Url 2- create a service to use this config 3- use this Url into all my APIs so if i changed this Url on my local Machin no API will work that is exactly what happen when production so i created this file into assets folder to allow any one has this publish to just change the Url within Config.json file to his localhost and it will work very well so where is the problem ?? the problem within environment file which deleted when production and this file includes my Machin localhost so if any one take this publish will not work because he hasn't environment file so i want to make all code into environment file to be within config.json file.

summery:

1- when i publish my project it will remove environment file which includes outh login page 2- i want to make this logic within config.json file to make my partner just change localhost to his localhost 3- then i will remove environment files it will not affect on project because it will be useless

-- images will include 1- config.json 2- service to use it 3- example for API 4- environment file

  • ABP Framework version: v8.2
  • UI Type: Angular

4 Answer(s)
  • User Avatar
    0
    nabass created

    any body here ?

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    They are not gone, they just compressed

  • User Avatar
    0
    nabass created

    hi lian you are not responding to my question you didn't read my question how can i ignore environment file and use config file if i let it within environment so when anybody take this build will not change the localhost to his what should i do ??

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    I think you can set the environment value in this way. Read from your config and set to environment https://abp.io/docs/latest/framework/ui/angular/environment#how-to-set-the-environment

Made with ❤️ on ABP v9.1.0-preview. Updated on November 20, 2024, 13:06